overlay: use precompiler macros for reoccuring path names
authorDaniel Golle <daniel@makrotopia.org>
Thu, 15 Oct 2020 23:31:15 +0000 (00:31 +0100)
committerDaniel Golle <daniel@makrotopia.org>
Fri, 16 Oct 2020 00:48:46 +0000 (01:48 +0100)
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
libfstools/overlay.c

index 39215d5926a9b72728f6f9e201e0580c4bf78f58..508d23fc76aa13b29788bf8310df70ff37e2880a 100644 (file)
@@ -35,6 +35,7 @@
 #endif
 
 #define SWITCH_JFFS2 "/tmp/.switch_jffs2"
+#define OVERLAYDIR "/rom/overlay"
 
 static bool keep_sysupgrade;
 
@@ -181,11 +182,11 @@ switch2jffs(struct volume *v)
                return -1;
        }
 
-       creat("/tmp/.switch_jffs2", 0600);
-       ret = mount(v->blk, "/rom/overlay", "jffs2", MS_NOATIME, NULL);
-       unlink("/tmp/.switch_jffs2");
+       creat(SWITCH_JFFS2, 0600);
+       ret = mount(v->blk, OVERLAYDIR, "jffs2", MS_NOATIME, NULL);
+       unlink(SWITCH_JFFS2);
        if (ret) {
-               ULOG_ERR("failed - mount -t jffs2 %s /rom/overlay: %m\n", v->blk);
+               ULOG_ERR("failed - mount -t jffs2 %s %s: %m\n", v->blk, OVERLAYDIR);
                return -1;
        }