]> code.citadel.org Git - citadel.git/blobdiff - citadel/aidepost.c
fix build for Solaris
[citadel.git] / citadel / aidepost.c
index c7a7265c60787eb995c01b9dea6e5d641cf2be38..3591ff8962fbd33c107050afafbbf27fc96f2c28 100644 (file)
@@ -98,10 +98,13 @@ int main(int argc, char **argv)
        }
 
        snprintf(tempspool, sizeof tempspool,
-               "./network/spoolin/ap.%04x",
-               getpid());
+               "./network/spoolin/ap.%04lx",
+               (long)getpid());
 
-       tempfp = tmpfile();
+       unlink(tempspool);
+
+       tempfp = fopen(tempspool, "w+b");
+       unlink(tempspool);
        if (tempfp == NULL) {
                perror("cannot open temp file");
                exit(errno);