prototype getfdtype
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Sat, 2 Apr 1994 22:46:04 +0000 (14:46 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Sat, 2 Apr 1994 22:46:04 +0000 (14:46 -0800)
SCCS-vsn: bin/dd/dd.c 8.4

usr/src/bin/dd/dd.c

index ed7ba8b..428a6d9 100644 (file)
@@ -16,7 +16,7 @@ static char copyright[] =
 #endif /* not lint */
 
 #ifndef lint
 #endif /* not lint */
 
 #ifndef lint
-static char sccsid[] = "@(#)dd.c       8.3 (Berkeley) %G%";
+static char sccsid[] = "@(#)dd.c       8.4 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/param.h>
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -39,6 +39,7 @@ static char sccsid[] = "@(#)dd.c      8.3 (Berkeley) %G%";
 
 static void dd_close __P((void));
 static void dd_in __P((void));
 
 static void dd_close __P((void));
 static void dd_in __P((void));
+static void getfdtype __P((IO *));
 static void setup __P((void));
 
 IO     in, out;                /* input/output state */
 static void setup __P((void));
 
 IO     in, out;                /* input/output state */
@@ -70,21 +71,6 @@ main(argc, argv)
        exit(0);
 }
 
        exit(0);
 }
 
-static void
-getfdtype(io)
-       IO *io;
-{
-       struct mtget mt;
-       struct stat sb;
-
-       if (fstat(io->fd, &sb))
-               err(1, "%s", io->name);
-       if (S_ISCHR(sb.st_mode))
-               io->flags |= ioctl(io->fd, MTIOCGET, &mt) ? ISCHR : ISTAPE;
-       else if (lseek(io->fd, (off_t)0, SEEK_CUR) == -1 && errno == ESPIPE)
-               io->flags |= ISPIPE;            /* XXX fixed in 4.4BSD */
-}
-
 static void
 setup()
 {
 static void
 setup()
 {
@@ -186,6 +172,21 @@ setup()
        (void)time(&st.start);                  /* Statistics timestamp. */
 }
 
        (void)time(&st.start);                  /* Statistics timestamp. */
 }
 
+static void
+getfdtype(io)
+       IO *io;
+{
+       struct mtget mt;
+       struct stat sb;
+
+       if (fstat(io->fd, &sb))
+               err(1, "%s", io->name);
+       if (S_ISCHR(sb.st_mode))
+               io->flags |= ioctl(io->fd, MTIOCGET, &mt) ? ISCHR : ISTAPE;
+       else if (lseek(io->fd, (off_t)0, SEEK_CUR) == -1 && errno == ESPIPE)
+               io->flags |= ISPIPE;            /* XXX fixed in 4.4BSD */
+}
+
 static void
 dd_in()
 {
 static void
 dd_in()
 {