X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=sidebyside;f=main.c;h=9172ab6d7b9d049c6c432b063e24c1f82caa2d93;hb=b70580815b02ba5ccf83d8d96c5138afbc7124ae;hp=8f939e60696764d39be3e56558026a779a20d8c5;hpb=c82820575ca9b801689e878974af15565075ae49;p=pmount-gui.git diff --git a/main.c b/main.c index 8f939e6..9172ab6 100644 --- a/main.c +++ b/main.c @@ -95,11 +95,12 @@ Property *get_device_properties(char *node) if(!udevadm_path) { + struct stat st; udevadm_path = "/bin/udevadm"; - if(access(udevadm_path, X_OK)<0) + if(stat(udevadm_path, &st)<0 || !(st.st_mode&0111)) { udevadm_path = "/sbin/udevadm"; - if(access(udevadm_path, X_OK)<0) + if(stat(udevadm_path, &st)<0 || !(st.st_mode&0111)) { udevadm_path = NULL; perror("Unable to find udevadm"); @@ -542,7 +543,6 @@ Device *get_devices(void) char **nodes = NULL; Device *devices = NULL; int n_devices = 0; - char **mounted = NULL; char **fstab = NULL; int i; @@ -561,6 +561,7 @@ Device *get_devices(void) { if(verbosity>=2) printf(" No properties\n"); + free(nodes[i]); continue; } @@ -626,7 +627,7 @@ Device *get_devices(void) } free(nodes); - free_string_array(mounted); + free_string_array(fstab); if(devices) {