@@ -252,15 +252,15 @@ extern "C" FILEHANDLE PREFIX(_open)(const char* name, int openmode) {
252
252
/* The first part of the filename (between first 2 '/') is not a
253
253
* registered mount point in the namespace.
254
254
*/
255
- return handle_open_errors (-ENOENT , fh_i);
255
+ return handle_open_errors (-ENODEV , fh_i);
256
256
}
257
257
258
258
if (path.isFile ()) {
259
259
res = path.file ();
260
260
} else {
261
261
FileSystemHandle *fs = path.fileSystem ();
262
262
if (fs == NULL ) {
263
- return handle_open_errors (-ENOENT , fh_i);
263
+ return handle_open_errors (-ENODEV , fh_i);
264
264
}
265
265
int posix_mode = openmode_to_posix (openmode);
266
266
int err = fs->open (&res, path.fileName (), posix_mode);
@@ -565,7 +565,7 @@ extern "C" int remove(const char *path) {
565
565
FilePath fp (path);
566
566
FileSystemHandle *fs = fp.fileSystem ();
567
567
if (fs == NULL ) {
568
- errno = ENOENT ;
568
+ errno = ENODEV ;
569
569
return -1 ;
570
570
}
571
571
@@ -585,7 +585,7 @@ extern "C" int rename(const char *oldname, const char *newname) {
585
585
FileSystemHandle *fsNew = fpNew.fileSystem ();
586
586
587
587
if (fsOld == NULL ) {
588
- errno = ENOENT ;
588
+ errno = ENODEV ;
589
589
return -1 ;
590
590
}
591
591
@@ -625,7 +625,7 @@ extern "C" DIR *opendir(const char *path) {
625
625
FilePath fp (path);
626
626
FileSystemHandle* fs = fp.fileSystem ();
627
627
if (fs == NULL ) {
628
- errno = ENOENT ;
628
+ errno = ENODEV ;
629
629
return NULL ;
630
630
}
631
631
@@ -677,7 +677,10 @@ extern "C" void seekdir(DIR *dir, off_t off) {
677
677
extern " C" int mkdir (const char *path, mode_t mode) {
678
678
FilePath fp (path);
679
679
FileSystemHandle *fs = fp.fileSystem ();
680
- if (fs == NULL ) return -1 ;
680
+ if (fs == NULL ) {
681
+ errno = ENODEV;
682
+ return -1 ;
683
+ }
681
684
682
685
int err = fs->mkdir (fp.fileName (), mode);
683
686
if (err < 0 ) {
@@ -691,7 +694,10 @@ extern "C" int mkdir(const char *path, mode_t mode) {
691
694
extern " C" int stat (const char *path, struct stat *st) {
692
695
FilePath fp (path);
693
696
FileSystemHandle *fs = fp.fileSystem ();
694
- if (fs == NULL ) return -1 ;
697
+ if (fs == NULL ) {
698
+ errno = ENODEV;
699
+ return -1 ;
700
+ }
695
701
696
702
int err = fs->stat (fp.fileName (), st);
697
703
if (err < 0 ) {
0 commit comments