File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed
Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -1033,6 +1033,16 @@ static int verify_fsroot_dir(
10331033 SYNTHETIC_ERRNO (searching ? EADDRNOTAVAIL : ENODEV ),
10341034 "Block device node of \"%s\" is invalid." , path );
10351035
1036+ if (path_equal (path , "/" )) {
1037+ /* Let's assume that the root directory of the OS is always the root of its file system
1038+ * (which technically doesn't have to be the case, but it's close enough, and it's not easy
1039+ * to be fully correct for it, since we can't look further up than the root dir easily.) */
1040+ if (ret_dev )
1041+ * ret_dev = st .st_dev ;
1042+
1043+ return 0 ;
1044+ }
1045+
10361046 t2 = strjoina (path , "/.." );
10371047 if (stat (t2 , & st2 ) < 0 ) {
10381048 if (errno != EACCES )
@@ -1048,10 +1058,7 @@ static int verify_fsroot_dir(
10481058 if (!parent )
10491059 return log_oom ();
10501060
1051- if (stat (parent , & st2 ) < 0 )
1052- r = - errno ;
1053- else
1054- r = 0 ;
1061+ r = stat (parent , & st2 ) < 0 ? - errno : 0 ;
10551062 }
10561063
10571064 if (r < 0 )
You can’t perform that action at this time.
0 commit comments