summaryrefslogtreecommitdiffstats
path: root/login-utils/wall.c
diff options
context:
space:
mode:
authorKarel Zak2010-12-10 16:22:29 +0100
committerKarel Zak2010-12-10 16:22:29 +0100
commit00f41c7dfd561a34ac9afee10a273dd8c65d4d56 (patch)
tree631869fef71db24f03336b48d45afc3db231a01e /login-utils/wall.c
parentwall: remove progname (diff)
downloadkernel-qcow2-util-linux-00f41c7dfd561a34ac9afee10a273dd8c65d4d56.tar.gz
kernel-qcow2-util-linux-00f41c7dfd561a34ac9afee10a273dd8c65d4d56.tar.xz
kernel-qcow2-util-linux-00f41c7dfd561a34ac9afee10a273dd8c65d4d56.zip
wall: fix coding style
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'login-utils/wall.c')
-rw-r--r--login-utils/wall.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/login-utils/wall.c b/login-utils/wall.c
index 383873b58..2ecce126b 100644
--- a/login-utils/wall.c
+++ b/login-utils/wall.c
@@ -95,7 +95,7 @@ main(int argc, char **argv) {
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
- while ((ch = getopt(argc, argv, "n")) != -1)
+ while ((ch = getopt(argc, argv, "n")) != -1) {
switch (ch) {
case 'n':
/* undoc option for shutdown: suppress banner */
@@ -109,6 +109,7 @@ usage:
program_invocation_short_name);
exit(EXIT_FAILURE);
}
+ }
argc -= optind;
argv += optind;
if (argc > 1)
@@ -159,11 +160,11 @@ makemsg(fname)
lbuf[MAXHOSTNAMELEN + 320],
tmpname[sizeof(_PATH_TMP) + 20];
- (void)sprintf(tmpname, "%s/wall.XXXXXX", _PATH_TMP);
+ sprintf(tmpname, "%s/wall.XXXXXX", _PATH_TMP);
if (!(fd = mkstemp(tmpname)) || !(fp = fdopen(fd, "r+")))
errx(EXIT_FAILURE, _("can't open temporary file"));
- (void)unlink(tmpname);
+ unlink(tmpname);
if (!nobanner) {
if (!(whom = getlogin()) || !*whom)
@@ -173,8 +174,8 @@ makemsg(fname)
where = ttyname(2);
if (!where || strlen(where) > 100)
where = "somewhere";
- (void)gethostname(hostname, sizeof(hostname));
- (void)time(&now);
+ gethostname(hostname, sizeof(hostname));
+ time(&now);
lt = localtime(&now);
/*
@@ -186,15 +187,15 @@ makemsg(fname)
*/
/* snprintf is not always available, but the sprintf's here
will not overflow as long as %d takes at most 100 chars */
- (void)fprintf(fp, "\r%79s\r\n", " ");
- (void)sprintf(lbuf, _("Broadcast Message from %s@%s"),
+ fprintf(fp, "\r%79s\r\n", " ");
+ sprintf(lbuf, _("Broadcast Message from %s@%s"),
whom, hostname);
- (void)fprintf(fp, "%-79.79s\007\007\r\n", lbuf);
- (void)sprintf(lbuf, " (%s) at %d:%02d ...",
+ fprintf(fp, "%-79.79s\007\007\r\n", lbuf);
+ sprintf(lbuf, " (%s) at %d:%02d ...",
where, lt->tm_hour, lt->tm_min);
- (void)fprintf(fp, "%-79.79s\r\n", lbuf);
+ fprintf(fp, "%-79.79s\r\n", lbuf);
}
- (void)fprintf(fp, "%79s\r\n", " ");
+ fprintf(fp, "%79s\r\n", " ");
if (fname) {
/*
@@ -237,5 +238,5 @@ makemsg(fname)
if (fread(mbuf, sizeof(*mbuf), mbufsize, fp) != mbufsize)
err(EXIT_FAILURE, _("fread failed"));
- (void)close(fd);
+ close(fd);
}