[Pkg-sysvinit-commits] r254 - sysvinit/trunk/src
Thomas Hood
jdthood-guest at costa.debian.org
Thu Nov 24 16:10:25 UTC 2005
Author: jdthood-guest
Date: 2005-11-24 16:10:25 +0000 (Thu, 24 Nov 2005)
New Revision: 254
Modified:
sysvinit/trunk/src/dowall.c
sysvinit/trunk/src/shutdown.c
Log:
Restore src/shutdown.c src/dowall.c to original
Modified: sysvinit/trunk/src/dowall.c
===================================================================
--- sysvinit/trunk/src/dowall.c 2005-11-24 16:09:17 UTC (rev 253)
+++ sysvinit/trunk/src/dowall.c 2005-11-24 16:10:25 UTC (rev 254)
@@ -65,7 +65,7 @@
uid_t uid;
char *tty;
static char uidbuf[32];
- static char ttynm[UT_LINESIZE + 4];
+ static char ttynm[32];
static int init = 0;
if (!init) {
@@ -131,7 +131,6 @@
time_t t;
char term[UT_LINESIZE+6];
char line[81];
- char hostname[256]; /* HOST_NAME_MAX+1 */
char *date, *p;
char *user, *tty;
int fd, flags;
@@ -145,16 +144,6 @@
getuidtty(&user, &tty);
- /* Get and report current hostname, to make it easier to find
- out which machine is being shut down. */
- if (0 != gethostname(hostname, sizeof(hostname))) {
- strncpy(hostname, "[unknown]", sizeof(hostname)-1);
- }
- /* If hostname is truncated, it is unspecified if the string
- is null terminated or not. Make sure we know it is null
- terminated. */
- hostname[sizeof(hostname)-1] = 0;
-
/* Get the time */
time(&t);
date = ctime(&t);
@@ -168,8 +157,8 @@
date);
} else {
snprintf(line, sizeof(line),
- "\007\r\nBroadcast message from %s@%s %s(%s):\r\n\r\n",
- user, hostname, tty, date);
+ "\007\r\nBroadcast message from %s %s(%s):\r\n\r\n",
+ user, tty, date);
}
/*
@@ -191,7 +180,7 @@
utmp->ut_user[0] == 0) continue;
if (strncmp(utmp->ut_line, "/dev/", 5) == 0) {
term[0] = 0;
- strncat(term, utmp->ut_line, sizeof(term)-1);
+ strncat(term, utmp->ut_line, UT_LINESIZE);
} else
snprintf(term, sizeof(term), "/dev/%.*s",
UT_LINESIZE, utmp->ut_line);
Modified: sysvinit/trunk/src/shutdown.c
===================================================================
--- sysvinit/trunk/src/shutdown.c 2005-11-24 16:09:17 UTC (rev 253)
+++ sysvinit/trunk/src/shutdown.c 2005-11-24 16:10:25 UTC (rev 254)
@@ -521,12 +521,6 @@
}
}
- if (NULL != halttype && down_level[0] != '0') {
- fprintf(stderr, "shutdown: -H and -P flags needs -h flag.\n");
- usage();
- exit(1);
- }
-
/* Do we need to use the shutdown.allow file ? */
if (useacl && (fp = fopen(SDALLOW, "r")) != NULL) {
More information about the Pkg-sysvinit-commits
mailing list