]> arthur.barton.de Git - netatalk.git/blobdiff - bin/megatron/megatron.c
Merge master
[netatalk.git] / bin / megatron / megatron.c
index 583465a9beec09eeaf3fb7bdbaa9c40d57fbcc80..f47a6dac7c8e9b681b57c01c22cf771e32ce5ebf 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: megatron.c,v 1.13 2009-10-14 02:24:04 didg Exp $
+ * $Id: megatron.c,v 1.14 2010-01-27 21:27:53 didg Exp $
  */
 
 #ifdef HAVE_CONFIG_H
@@ -10,9 +10,7 @@
 #include <sys/param.h>
 #include <sys/stat.h>
 #include <sys/uio.h>
-#ifdef HAVE_FCNTL_H
 #include <fcntl.h>
-#endif /* HAVE_FCNTL_H */
 #include <time.h>
 #include <ctype.h>
 #include <stdio.h>
@@ -61,7 +59,7 @@ static int from_open(int un, char *file, struct FHeader *fh, int flags)
     }
 }
 
-static int from_read(int un, int fork, char *buf, int len)
+static ssize_t from_read(int un, int fork, char *buf, size_t len)
 {
     switch ( un ) {
        case MEGATRON :
@@ -127,7 +125,7 @@ static int to_open(int to, char *file, struct FHeader *fh, int flags)
     }
 }
 
-static int to_write(int to, int fork, int bufc)
+static ssize_t to_write(int to, int fork, size_t bufc)
 {
     switch ( to ) {
        case MEGATRON :
@@ -171,9 +169,9 @@ static int megatron( char *path, int module, char *newname, int flags)
 {
     struct stat                st;
     struct FHeader     fh;
-    int                        bufc;
+    ssize_t            bufc;
     int                        fork;
-    unsigned int       forkred;
+    size_t             forkred;
 
 /*
  * If the source file is not stdin, make sure it exists and