View | Details | Raw Unified | Return to bug 177047 | Differences between
and this patch

Collapse All | Expand All

(-)/home/zxadmin/wall/wall.c 2013-03-17 11:00:40.000000000 +0200 (-3 / +3 lines)
Lines 204-210 Link Here
204
       time_t now;
204
       time_t now;
205
       FILE *fp;
205
       FILE *fp;
206
       int fd;
206
       int fd;
207
       char *p, hostname[MAXHOSTNAMELEN], lbuf[256], tmpname[64];
207
       char *p, hostname[MAXHOSTNAMELEN], lbuf[256], tmpname[64], datestr[20];
208
       const char *tty;
208
       const char *tty;
209
       const char *whom;
209
       const char *whom;
210
       gid_t egid;
210
       gid_t egid;
Lines 224-229 Link Here
224
               (void)gethostname(hostname, sizeof(hostname));
224
               (void)gethostname(hostname, sizeof(hostname));
225
               (void)time(&now);
225
               (void)time(&now);
226
               lt = localtime(&now);
226
               lt = localtime(&now);
227
               (void)strftime(datestr, sizeof datestr, "%b %d %H:%M %Z", lt);
227
               /*
228
               /*
228
                * all this stuff is to blank out a square for the message;
229
                * all this stuff is to blank out a square for the message;
Lines 238-245 Link Here
238
                   whom, hostname);
239
                   whom, hostname);
239
               (void)fprintf(fp, "%-79.79s\007\007\r\n", lbuf);
240
               (void)fprintf(fp, "%-79.79s\007\007\r\n", lbuf);
240
               (void)snprintf(lbuf, sizeof(lbuf),
241
               (void)snprintf(lbuf, sizeof(lbuf),
241
                   "        (%s) at %d:%02d %s...", tty,
242
                   "        (%s) at %s...", tty, datestr);
242
                   lt->tm_hour, lt->tm_min, lt->tm_zone);
243
               (void)fprintf(fp, "%-79.79s\r\n", lbuf);
243
               (void)fprintf(fp, "%-79.79s\r\n", lbuf);
244
       }
244
       }
245
       (void)fprintf(fp, "%79s\r\n", " ");
245
       (void)fprintf(fp, "%79s\r\n", " ");

Return to bug 177047