allow size set
authorAndrew Tridgell <tridge@samba.org>
Tue, 28 Oct 2008 10:25:47 +0000 (21:25 +1100)
committerAndrew Tridgell <tridge@samba.org>
Tue, 28 Oct 2008 10:25:47 +0000 (21:25 +1100)
truncate.c

index 2d0d249..683e800 100644 (file)
@@ -1,11 +1,13 @@
 #include <stdio.h>
 #include <unistd.h>
+#include <stdlib.h>
 #include <fcntl.h>
 
 int main(int argc, char *argv[])
 {
        int fd;
        fd = open(argv[1], O_RDWR|O_CREAT|O_TRUNC, 0600);
-       ftruncate(fd, 1);
+       ftruncate(fd, strtoull(argv[2], NULL, 0));
        close(fd);
+       return 0;
 }