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