diff options
Diffstat (limited to 'amd/amd.c')
-rw-r--r-- | amd/amd.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/amd/amd.c b/amd/amd.c index 37eab5d8442c..d06b713c0e21 100644 --- a/amd/amd.c +++ b/amd/amd.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997-2006 Erez Zadok + * Copyright (c) 1997-2014 Erez Zadok * Copyright (c) 1989 Jan-Simon Pendry * Copyright (c) 1989 Imperial College of Science, Technology & Medicine * Copyright (c) 1989 The Regents of the University of California. @@ -16,11 +16,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgment: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * @@ -375,7 +371,7 @@ do_memory_locking(void) #endif /* HAVE_PLOCK || HAVE_MLOCKALL */ #if defined(HAVE_MADVISE) && defined(MADV_PROTECT) - madvise(0, 0, MADV_PROTECT); /* may be redundant of the above worked out */ + madvise(NULL, 0, MADV_PROTECT); /* may be redundant of the above worked out */ #endif /* defined(HAVE_MADVISE) && defined(MADV_PROTECT) */ } @@ -427,6 +423,7 @@ main(int argc, char *argv[]) if (gethostname(hostname, sizeof(hostname)) < 0) { plog(XLOG_FATAL, "gethostname: %m"); going_down(1); + return 1; } hostname[sizeof(hostname) - 1] = '\0'; @@ -436,6 +433,7 @@ main(int argc, char *argv[]) if (!*hostname) { plog(XLOG_FATAL, "host name is not set"); going_down(1); + return 1; } /* @@ -494,7 +492,8 @@ main(int argc, char *argv[]) getwire(&PrimNetName, &PrimNetNum); /* - * Determine command-line arguments + * Determine command-line arguments. + * (Also initialize amd.conf parameters, maps, and more.) */ get_args(argc, argv); @@ -528,6 +527,7 @@ main(int argc, char *argv[]) if (geteuid() != 0) { plog(XLOG_FATAL, "Must be root to mount filesystems (euid = %ld)", (long) geteuid()); going_down(1); + return 1; } #ifdef HAVE_MAP_NIS @@ -539,10 +539,11 @@ main(int argc, char *argv[]) if (gopt.nis_domain && yp_bind(gopt.nis_domain)) { plog(XLOG_FATAL, "Can't bind to NIS domain \"%s\"", gopt.nis_domain); going_down(1); + return 1; } #endif /* HAVE_MAP_NIS */ - if (!amuDebug(D_DAEMON)) + if (amuDebug(D_DAEMON)) ppid = daemon_mode(); /* |