summaryrefslogtreecommitdiffstats
path: root/lib/exec_shell.c
diff options
context:
space:
mode:
authorMike Frysinger2013-06-28 02:05:18 +0200
committerKarel Zak2013-07-01 11:46:13 +0200
commita84aa9df6f7eb012e10d322e21956aa4b4f195bb (patch)
tree770c31a6266dda42d467c6a2c0a1f5b774f95825 /lib/exec_shell.c
parentdmesg: define is_timefmt() macro only once (diff)
downloadkernel-qcow2-util-linux-a84aa9df6f7eb012e10d322e21956aa4b4f195bb.tar.gz
kernel-qcow2-util-linux-a84aa9df6f7eb012e10d322e21956aa4b4f195bb.tar.xz
kernel-qcow2-util-linux-a84aa9df6f7eb012e10d322e21956aa4b4f195bb.zip
exec_shell: add a license and touch up func def
When this file was created, the standard license header was missed. Add it using the same one from unshare.c. The noreturn attribute is not needed since we include the header which has it on the prototype. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'lib/exec_shell.c')
-rw-r--r--lib/exec_shell.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/lib/exec_shell.c b/lib/exec_shell.c
index 95620cd4d..2b263644d 100644
--- a/lib/exec_shell.c
+++ b/lib/exec_shell.c
@@ -1,3 +1,21 @@
+/*
+ * exec_shell() - launch a shell, else exit!
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
@@ -11,7 +29,8 @@
#define DEFAULT_SHELL "/bin/sh"
-void __attribute__((__noreturn__)) exec_shell(void) {
+void exec_shell(void)
+{
const char *shell = getenv("SHELL"), *shell_basename;
char *arg0;
if (!shell)