Drop ifdef nonsense: just use setvbuf(3).

Pointed out by:		kib, bde
This commit is contained in:
Pedro F. Giffuni 2014-06-21 14:07:33 +00:00
parent 0279beeb0e
commit 90d81f30ec
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=267703

View File

@ -162,20 +162,14 @@ main(int argc, char *argv[])
ispan = 0; /* don't span across input files */ ispan = 0; /* don't span across input files */
break; break;
case 'l': case 'l':
if(setlinebuf(stdout) != 0) if(setvbuf(stdout, NULL, _IOLBF, 0) != 0)
warnx("setlinebuf() failed"); warnx("setting line buffered output failed");
break; break;
case 'n': case 'n':
nflag = 1; nflag = 1;
break; break;
case 'u': case 'u':
#ifdef _IONBF if(setvbuf(stdout, NULL, _IONBF, 0) != 0)
c = setvbuf(stdout, NULL, _IONBF, 0);
#else
c = -1;
errno = EOPNOTSUPP;
#endif
if (c)
warnx("setting unbuffered output failed"); warnx("setting unbuffered output failed");
break; break;
default: default: