Codebase list openrc / a32b14b
Do not use UT_LINESIZE or __UT_LINESIZE These are not standard. For more information see issue #279. This fixes #279. William Hubbs 5 years ago
1 changed file(s) with 4 addition(s) and 9 deletion(s). Raw diff Collapse all Expand all
3636 # define _PATH_DEV "/dev/"
3737 #endif
3838
39 #ifndef UT_LINESIZE
40 #define UT_LINESIZE __UT_LINESIZE
41 #endif
42
4339 static sigjmp_buf jbuf;
4440
4541 /*
6157 uid_t uid;
6258 char *tty;
6359 static char uidbuf[32];
64 static char ttynm[UT_LINESIZE + 4];
60 char *ttynm = NULL;
6561
6662 uid = getuid();
6763 if ((pwd = getpwuid(uid)) != NULL) {
8177 if (tty[0] == '/')
8278 tty++;
8379 }
84 snprintf(ttynm, sizeof(ttynm), "(%.*s) ",
85 UT_LINESIZE, tty);
86 } else
87 ttynm[0] = 0;
80 xasprintf(&ttynm, "(%s) ", tty);
81 }
8882
8983 *userp = uidbuf;
9084 *ttyp = ttynm;
155149
156150 xasprintf(&line, "\007\r\nBroadcast message from %s@%s %s(%s):\r\n\r\n",
157151 user, name.nodename, tty, date);
152 free(tty);
158153
159154 /*
160155 * Fork to avoid hanging in a write()