OSDN Git Service

Change tmpfile path for diff to /data/local/tmp
authorDylan Simon <dylan@dylex.net>
Sun, 7 Feb 2010 22:34:41 +0000 (17:34 -0500)
committerDylan Simon <dylan@dylex.net>
Sun, 7 Feb 2010 22:34:41 +0000 (17:34 -0500)
editors/diff.c

index 5b7b51f..dc478e6 100644 (file)
@@ -672,7 +672,12 @@ static int diffreg(char *file[2])
                 * When we meet non-seekable file, we must make a temp copy.
                 */
                if (lseek(fd, 0, SEEK_SET) == -1 && errno == ESPIPE) {
-                       char name[] = "/tmp/difXXXXXX";
+                       /* really should use $TMPDIR, but not usually set on android anyway */
+                       char name[] = 
+#ifdef __BIONIC__
+                               "/data/local"
+#endif
+                               "/tmp/difXXXXXX";
                        int fd_tmp = mkstemp(name);
                        if (fd_tmp < 0)
                                bb_perror_msg_and_die("mkstemp");