Changeset 84a1a54 in mainline for uspace/srv/fs


Ignore:
Timestamp:
2018-01-04T20:47:53Z (8 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Children:
facacc71
Parents:
cde999a
Message:

Wrap returns of errno from main() with EXIT_RC().

Returns of error code from main() prevent type checking when errno_t
and int are considered incompatible. In order to avoid the philosophical
discussion of what should and shouldn't be returned for main(), we simply
wrap the error values and leave the answer to the question for future
generations to decide.

Location:
uspace/srv/fs
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/fs/cdfs/cdfs.c

    rcde999a r84a1a54  
    4343#include <str_error.h>
    4444#include <stdio.h>
     45#include <stdlib.h>
    4546#include <libfs.h>
    4647#include "cdfs.h"
     
    8586        if (rc != EOK) {
    8687                printf("%s: Failed to register file system: %s\n", NAME, str_error(rc));
    87                 return rc;
     88                return EXIT_RC(rc);
    8889        }
    8990       
  • uspace/srv/fs/exfat/exfat.c

    rcde999a r84a1a54  
    4646#include <task.h>
    4747#include <stdio.h>
     48#include <stdlib.h>
    4849#include <libfs.h>
    4950#include "../../vfs/vfs.h"
     
    9798err:
    9899        printf(NAME ": Failed to register file system: %s\n", str_error(rc));
    99         return rc;
     100        return EXIT_RC(rc);
    100101}
    101102
  • uspace/srv/fs/ext4fs/ext4fs.c

    rcde999a r84a1a54  
    4040#include <ns.h>
    4141#include <stdio.h>
     42#include <stdlib.h>
    4243#include <task.h>
    4344#include <ipc/services.h>
     
    7576        if (rc != EOK) {
    7677                printf("%s: Global initialization failed\n", NAME);
    77                 return rc;
     78                return EXIT_RC(rc);
    7879        }
    7980       
     
    8283        if (rc != EOK) {
    8384                printf("%s: Failed to register file system\n", NAME);
    84                 return rc;
     85                return EXIT_RC(rc);
    8586        }
    8687       
  • uspace/srv/fs/fat/fat.c

    rcde999a r84a1a54  
    4646#include <task.h>
    4747#include <stdio.h>
     48#include <stdlib.h>
    4849#include <libfs.h>
    4950#include "../../vfs/vfs.h"
     
    9798err:
    9899        printf(NAME ": Failed to register file system: %s\n", str_error(rc));
    99         return rc;
     100        return EXIT_RC(rc);
    100101}
    101102
  • uspace/srv/fs/locfs/locfs.c

    rcde999a r84a1a54  
    4040
    4141#include <stdio.h>
     42#include <stdlib.h>
    4243#include <ipc/services.h>
    4344#include <ns.h>
     
    8990        if (rc != EOK) {
    9091                printf("%s: Failed to register file system: %s\n", NAME, str_error(rc));
    91                 return rc;
     92                return EXIT_RC(rc);
    9293        }
    9394       
  • uspace/srv/fs/mfs/mfs.c

    rcde999a r84a1a54  
    100100err:
    101101        printf(NAME ": Failed to register file system: %s\n", str_error(rc));
    102         return rc;
     102        return EXIT_RC(rc);
    103103}
    104104
  • uspace/srv/fs/tmpfs/tmpfs.c

    rcde999a r84a1a54  
    4848#include <str_error.h>
    4949#include <stdio.h>
     50#include <stdlib.h>
    5051#include <task.h>
    5152#include <libfs.h>
     
    9192        if (rc != EOK) {
    9293                printf(NAME ": Failed to register file system: %s\n", str_error(rc));
    93                 return rc;
     94                return EXIT_RC(rc);
    9495        }
    9596       
  • uspace/srv/fs/udf/udf.c

    rcde999a r84a1a54  
    4242#include <errno.h>
    4343#include <str_error.h>
     44#include <stdlib.h>
    4445#include <task.h>
    4546#include <libfs.h>
     
    9899err:
    99100        log_msg(LOG_DEFAULT, LVL_FATAL, "Failed to register file system: %s", str_error(rc));
    100         return rc;
     101        return EXIT_RC(rc);
    101102}
    102103
Note: See TracChangeset for help on using the changeset viewer.