]> git.tdb.fi Git - pmount-gui.git/blobdiff - main.c
Use stat instead of access to check for udevadm presence
[pmount-gui.git] / main.c
diff --git a/main.c b/main.c
index 76632ab3d50b056063beea31e4a9061c7ea9609e..9172ab6d7b9d049c6c432b063e24c1f82caa2d93 100644 (file)
--- 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");