amd.c (38495) | amd.c (38500) |
---|---|
1/* 2 * Copyright (c) 1997-1998 Erez Zadok 3 * Copyright (c) 1989 Jan-Simon Pendry 4 * Copyright (c) 1989 Imperial College of Science, Technology & Medicine 5 * Copyright (c) 1989 The Regents of the University of California. 6 * All rights reserved. 7 * 8 * This code is derived from software contributed to Berkeley by --- 24 unchanged lines hidden (view full) --- 33 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 34 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 36 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 37 * SUCH DAMAGE. 38 * 39 * %W% (Berkeley) %G% 40 * | 1/* 2 * Copyright (c) 1997-1998 Erez Zadok 3 * Copyright (c) 1989 Jan-Simon Pendry 4 * Copyright (c) 1989 Imperial College of Science, Technology & Medicine 5 * Copyright (c) 1989 The Regents of the University of California. 6 * All rights reserved. 7 * 8 * This code is derived from software contributed to Berkeley by --- 24 unchanged lines hidden (view full) --- 33 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 34 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 36 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 37 * SUCH DAMAGE. 38 * 39 * %W% (Berkeley) %G% 40 * |
41 * $Id: amd.c,v 5.2.2.1 1992/02/09 15:08:15 jsp beta $ | 41 * $Id: amd.c,v 1.1.1.1 1998/08/23 22:07:20 obrien Exp $ |
42 * 43 */ 44 45/* 46 * Automounter 47 */ 48 49#ifdef HAVE_CONFIG_H 50# include <config.h> 51#endif /* HAVE_CONFIG_H */ 52#include <am_defs.h> 53#include <amd.h> 54 55struct amu_global_options gopt; /* where global options are stored */ 56 57char pid_fsname[16 + MAXHOSTNAMELEN]; /* "kiska.southseas.nz:(pid%d)" */ 58char *progname; /* "amd" */ 59char *hostdomain = "unknown.domain"; | 42 * 43 */ 44 45/* 46 * Automounter 47 */ 48 49#ifdef HAVE_CONFIG_H 50# include <config.h> 51#endif /* HAVE_CONFIG_H */ 52#include <am_defs.h> 53#include <amd.h> 54 55struct amu_global_options gopt; /* where global options are stored */ 56 57char pid_fsname[16 + MAXHOSTNAMELEN]; /* "kiska.southseas.nz:(pid%d)" */ 58char *progname; /* "amd" */ 59char *hostdomain = "unknown.domain"; |
60char hostname[MAXHOSTNAMELEN] = "localhost"; /* Hostname */ 61char hostd[2 * MAXHOSTNAMELEN]; /* Host+domain */ | 60char hostname[MAXHOSTNAMELEN + 1] = "localhost"; /* Hostname */ 61char hostd[2 * MAXHOSTNAMELEN + 1]; /* Host+domain */ |
62char *endian = ARCH_ENDIAN; /* Big or Little endian */ 63char *cpu = HOST_CPU; /* CPU type */ 64char *PrimNetName; /* name of primary network */ 65char *PrimNetNum; /* number of primary network */ 66 67int foreground = 1; /* This is the top-level server */ 68int immediate_abort; /* Should close-down unmounts be retried */ 69int orig_umask; --- 274 unchanged lines hidden (view full) --- 344 345 /* 346 * Get local machine name 347 */ 348 if (gethostname(hostname, sizeof(hostname)) < 0) { 349 plog(XLOG_FATAL, "gethostname: %m"); 350 going_down(1); 351 } | 62char *endian = ARCH_ENDIAN; /* Big or Little endian */ 63char *cpu = HOST_CPU; /* CPU type */ 64char *PrimNetName; /* name of primary network */ 65char *PrimNetNum; /* number of primary network */ 66 67int foreground = 1; /* This is the top-level server */ 68int immediate_abort; /* Should close-down unmounts be retried */ 69int orig_umask; --- 274 unchanged lines hidden (view full) --- 344 345 /* 346 * Get local machine name 347 */ 348 if (gethostname(hostname, sizeof(hostname)) < 0) { 349 plog(XLOG_FATAL, "gethostname: %m"); 350 going_down(1); 351 } |
352 hostname[sizeof(hostname) - 1] = '\0'; |
|
352 353 /* 354 * Check it makes sense 355 */ 356 if (!*hostname) { 357 plog(XLOG_FATAL, "host name is not set"); 358 going_down(1); 359 } --- 176 unchanged lines hidden --- | 353 354 /* 355 * Check it makes sense 356 */ 357 if (!*hostname) { 358 plog(XLOG_FATAL, "host name is not set"); 359 going_down(1); 360 } --- 176 unchanged lines hidden --- |