]> code.citadel.org Git - citadel.git/blobdiff - citadel/aidepost.c
calculate the directories in a central manner.
[citadel.git] / citadel / aidepost.c
index c7a7265c60787eb995c01b9dea6e5d641cf2be38..0824189497432b6c29546884b3e374e9af0ba75d 100644 (file)
@@ -98,10 +98,14 @@ int main(int argc, char **argv)
        }
 
        snprintf(tempspool, sizeof tempspool,
-               "./network/spoolin/ap.%04x",
-               getpid());
+                        "%s/ap.%04lx",
+                        ctdl_netin_dir,
+               (long)getpid());
 
-       tempfp = tmpfile();
+       unlink(tempspool);
+
+       tempfp = fopen(tempspool, "w+b");
+       unlink(tempspool);
        if (tempfp == NULL) {
                perror("cannot open temp file");
                exit(errno);