]> git.lizzy.rs Git - plan9front.git/blobdiff - sys/src/libstdio/setvbuf.c
sdiahci, sdodin: avoid calling kproc() while holding ilock()
[plan9front.git] / sys / src / libstdio / setvbuf.c
old mode 100755 (executable)
new mode 100644 (file)
index 34c3bf7..e63e8db
@@ -31,12 +31,6 @@ int setvbuf(FILE *f, char *buf, int mode, long size){
        f->state=RDWR;
        return 0;
 }
-int _IO_setvbuf(FILE *f){
-       static int isatty(int);
-       if(f==stderr || (f==stdout && isatty(1)))
-               return setvbuf(f, (char *)0, _IOLBF, BUFSIZ);
-       else return setvbuf(f, (char *)0, _IOFBF, BUFSIZ);
-}
 static int
 isatty(int fd)
 {
@@ -48,3 +42,8 @@ isatty(int fd)
        /* might be /mnt/term/dev/cons */
        return strlen(buf) >= 9 && strcmp(buf+strlen(buf)-9, "/dev/cons") == 0;
 }
+int _IO_setvbuf(FILE *f){
+       if(f==stderr || (f==stdout && isatty(1)))
+               return setvbuf(f, (char *)0, _IOLBF, BUFSIZ);
+       else return setvbuf(f, (char *)0, _IOFBF, BUFSIZ);
+}