aboutsummaryrefslogtreecommitdiff
path: root/contrib/amd/amd/amd.c
diff options
context:
space:
mode:
authorCy Schubert <cy@FreeBSD.org>2016-11-11 02:42:53 +0000
committerCy Schubert <cy@FreeBSD.org>2016-11-11 02:42:53 +0000
commit449287a2a5ee4743d1e51b1cef8423cd5ac0703b (patch)
treecfabbc28c7e41c1de011661677a062cfd196415f /contrib/amd/amd/amd.c
parent3b49535a5a124165d6521ca19e12c0a457ca13b8 (diff)
parentca57057f598bfc7119f79f71bf38ec88244ab396 (diff)
downloadsrc-449287a2a5ee4743d1e51b1cef8423cd5ac0703b.tar.gz
src-449287a2a5ee4743d1e51b1cef8423cd5ac0703b.zip
MFV r305100: Update amd from am-utils 6.1.5 to 6.2.
Used extensively on my network over the past month. Reviewed by: pfg, brooks Suggested by: pfg Obtained from: ftp://ftp.am-utils.org/pub/am-utils/ MFC after: 6 weeks Relnotes: yes Differential Revision: D8405
Notes
Notes: svn path=/head/; revision=308493
Diffstat (limited to 'contrib/amd/amd/amd.c')
-rw-r--r--contrib/amd/amd/amd.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/contrib/amd/amd/amd.c b/contrib/amd/amd/amd.c
index 3fc25f833dbb..7ec49ce1cec5 100644
--- a/contrib/amd/amd/amd.c
+++ b/contrib/amd/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.
*
@@ -379,7 +375,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) */
}
@@ -431,6 +427,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';
@@ -440,6 +437,7 @@ main(int argc, char *argv[])
if (!*hostname) {
plog(XLOG_FATAL, "host name is not set");
going_down(1);
+ return 1;
}
/*
@@ -498,7 +496,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);
@@ -532,6 +531,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
@@ -543,10 +543,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();
/*