From: Rafał Miłecki Date: Fri, 16 Feb 2018 14:32:26 +0000 (+0100) Subject: mount: rename tmp variables in the mount_add_list() X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fmountd.git;a=commitdiff_plain;h=76766aef149ac5b9562ab9bcca33830f80beab9d mount: rename tmp variables in the mount_add_list() Both of them are used once only so there is no real need for the tmp(2) variables. We can just name them nicer to make code easier to read. Signed-off-by: Rafał Miłecki --- diff --git a/mount.c b/mount.c index bf5fbfd..f2c15a0 100644 --- a/mount.c +++ b/mount.c @@ -152,7 +152,7 @@ static void mount_add_list(char *name, char *dev, char *serial, char *vendor, char *model, char *rev, int ignore, char *size, char *sector_size, int fs) { struct mount *mount; - char tmp[64], tmp2[64]; + char dev_path[64], dev_link[64]; mount = malloc(sizeof(struct mount)); INIT_LIST_HEAD(&mount->list); @@ -172,9 +172,9 @@ static void mount_add_list(char *name, char *dev, char *serial, mount->status = STATUS_IGNORE; } else { log_printf("new mount : %s -> %s (%s)\n", name, dev, fs_names[mount->fs]); - snprintf(tmp, 64, "%s%s", uci_path, name); - snprintf(tmp2, 64, "/tmp/run/mountd/%s", dev); - symlink(tmp2, tmp); + snprintf(dev_link, sizeof(dev_link), "%s%s", uci_path, name); + snprintf(dev_path, sizeof(dev_path), "%s%s", "/tmp/run/mountd/", dev); + symlink(dev_path, dev_link); if (!mount_new("/tmp/run/mountd/", dev)) system_printf("ACTION=add DEVICE=%s NAME=%s /sbin/hotplug-call mount", dev, name); }