wall: add fallback for failed sysconf()
Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
parent
86c58c4a82
commit
479912e7b3
|
@ -187,6 +187,9 @@ static char *makemsg(char *fname, char **mvec, int mvecsz,
|
||||||
long line_max;
|
long line_max;
|
||||||
|
|
||||||
line_max = sysconf(_SC_LINE_MAX);
|
line_max = sysconf(_SC_LINE_MAX);
|
||||||
|
if (line_max <= 0)
|
||||||
|
line_max = 512;
|
||||||
|
|
||||||
lbuf = xmalloc(line_max);
|
lbuf = xmalloc(line_max);
|
||||||
|
|
||||||
if ((fp = xfmkstemp(&tmpname, NULL)) == NULL)
|
if ((fp = xfmkstemp(&tmpname, NULL)) == NULL)
|
||||||
|
|
Loading…
Reference in New Issue