]> arthur.barton.de Git - netatalk.git/blobdiff - bin/psorder/pa.c
Remove bdb env on exit
[netatalk.git] / bin / psorder / pa.c
index f1a52e8f32d68528b824e7847400518ed86d1419..8728065ccb5ae3e9fafadd840ab6cef1fc23685d 100644 (file)
@@ -1,4 +1,6 @@
 /*
+ * $Id: pa.c,v 1.6 2009-10-14 02:24:05 didg Exp $
+ *
  * Copyright (c) 1990,1991 Regents of The University of Michigan.
  * All Rights Reserved.
  *
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #include <stdlib.h>
 #include <string.h>
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif /* HAVE_UNISTD_H */
 
 #include "pa.h"
 
-pa_buf_t *pa_init( fd )
-       int fd;
+pa_buf_t *pa_init(int fd)
 {
        pa_buf_t *h;
        int rc;
@@ -44,7 +47,7 @@ pa_buf_t *pa_init( fd )
        h->bufsz = PA_BUFBLK * 2;
 
        if (( rc = read( fd, h->buf, PA_BUFBLK )) < 0 ) {
-               return( 0 );
+               return( NULL );
        }
 
        h->cur = h->buf - 1;
@@ -55,8 +58,7 @@ pa_buf_t *pa_init( fd )
        return( h );
 }
 
-char *pa_gettok( h )
-       pa_buf_t *h;
+char *pa_gettok(pa_buf_t *h)
 {
        h->state = PA_NORMAL;
        h->tmp = *(h->cur);
@@ -64,8 +66,7 @@ char *pa_gettok( h )
        return( h->mark );
 }
 
-char _pa_fixbuf( h )
-       pa_buf_t *h;
+char _pa_fixbuf(pa_buf_t *h)
 {
        int rc;
        char *t;