fs: add support for HFSX Plus file system
[project/mountd.git] / mount.c
diff --git a/mount.c b/mount.c
index 00fe91dbde9b82db2b8975f95935724ecb9ff23f..2d5114cf8cefcc5c972f7941c24bcf204d6062a6 100644 (file)
--- a/mount.c
+++ b/mount.c
 #include <sys/wait.h>
 #include <sys/inotify.h>
 #include <sys/mount.h>
-#include <sys/stat.h>
-#include <sys/types.h>
 #include <glob.h>
 #include <libgen.h>
 #include <poll.h>
-#include <dirent.h>
 #include <syslog.h>
 
 #include "include/log.h"
@@ -397,11 +394,12 @@ static char* mount_get_serial(char *dev)
                                {
                                        int id;
                                        struct stat buf;
-                                       char tmp3[64];
+                                       char tmp3[strlen(namelist[n]->d_name) + strlen(dev) + 31];
                                        int ret;
                                        *t = 0;
                                        id = atoi(namelist[n]->d_name);
                                        *t = ':';
+
                                        sprintf(tmp3, "/sys/bus/scsi/devices/%s/block:%s/", namelist[n]->d_name, dev);
                                        ret = stat(tmp3, &buf);
                                        if(ret)