diff options
Diffstat (limited to 'dev.c')
-rw-r--r-- | dev.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -84,10 +84,16 @@ const struct mog_dev *dev, struct mog_svc *svc, int fd, struct statvfs *v) int mog_dev_mkusage(const struct mog_dev *dev, struct mog_svc *svc) { struct statvfs v; - char *usage_path = xasprintf("%s/usage", dev->prefix); - char *tmp_path = xasprintf("%s.%x", usage_path, (unsigned)getpid()); + char *usage_path; + char *tmp_path; int fd = -1; + if (!svc->mgmt_mfd) + return 0; + + usage_path = xasprintf("%s/usage", dev->prefix); + tmp_path = xasprintf("%s.%x", usage_path, (unsigned)getpid()); + if (mog_unlink(svc, tmp_path) < 0 && errno != ENOENT) goto out; errno = 0; |