summaryrefslogtreecommitdiffstats
path: root/libc
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2009-09-05 23:35:09 +0200
committerAustin Foxley <austinf@cetoncorp.com>2009-09-18 11:33:03 -0700
commitb089e4c6f04697032796286ffb0c3e16138a5da4 (patch)
tree8a0c1406341d38727966926dbda54715d57559b8 /libc
parent31da19a6cb46f9e51744f11008deb76f72e1f673 (diff)
downloaduClibc-alpine-b089e4c6f04697032796286ffb0c3e16138a5da4.tar.bz2
uClibc-alpine-b089e4c6f04697032796286ffb0c3e16138a5da4.tar.xz
do not pass 3rd param to open() which do not create files
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com> Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
Diffstat (limited to 'libc')
-rw-r--r--libc/unistd/daemon.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/libc/unistd/daemon.c b/libc/unistd/daemon.c
index 88b75f857..e5417227b 100644
--- a/libc/unistd/daemon.c
+++ b/libc/unistd/daemon.c
@@ -54,14 +54,6 @@
#if defined __USE_BSD || (defined __USE_XOPEN && !defined __USE_UNIX98)
-/* libc_hidden_proto(open) */
-/* libc_hidden_proto(close) */
-/* libc_hidden_proto(_exit) */
-/* libc_hidden_proto(dup2) */
-/* libc_hidden_proto(setsid) */
-/* libc_hidden_proto(chdir) */
-/* libc_hidden_proto(fork) */
-
#ifndef __ARCH_USE_MMU__
#include <sys/syscall.h>
#include <sched.h>
@@ -98,7 +90,7 @@ static inline pid_t fork_parent(void)
}
#endif
-int daemon( int nochdir, int noclose )
+int daemon(int nochdir, int noclose)
{
int fd;
@@ -106,7 +98,7 @@ int daemon( int nochdir, int noclose )
return -1;
if (setsid() == -1)
- return(-1);
+ return -1;
#ifndef __UCLIBC_HAS_THREADS_NATIVE__
/* Make certain we are not a session leader, or else we
@@ -119,7 +111,7 @@ int daemon( int nochdir, int noclose )
chdir("/");
#ifndef __UCLIBC_HAS_THREADS_NATIVE__
- if (!noclose && (fd = open(_PATH_DEVNULL, O_RDWR, 0)) != -1)
+ if (!noclose && (fd = open(_PATH_DEVNULL, O_RDWR)) != -1)
{
#else
if (!noclose)
@@ -159,6 +151,6 @@ int daemon( int nochdir, int noclose )
}
#endif
}
- return(0);
+ return 0;
}
#endif