|
@@ -45,7 +45,7 @@ typedef __kernel_pid_t pid_t;
|
|
/* 'open' operation for file streams */
|
|
/* 'open' operation for file streams */
|
|
static int file_open(PAL_HANDLE* handle, const char* type, const char* uri, int access, int share,
|
|
static int file_open(PAL_HANDLE* handle, const char* type, const char* uri, int access, int share,
|
|
int create, int options) {
|
|
int create, int options) {
|
|
- if (!strcmp_static(type, "file"))
|
|
|
|
|
|
+ if (strcmp_static(type, "file"))
|
|
return -PAL_ERROR_INVAL;
|
|
return -PAL_ERROR_INVAL;
|
|
/* try to do the real open */
|
|
/* try to do the real open */
|
|
int fd = ocall_open(uri, access | create | options, share);
|
|
int fd = ocall_open(uri, access | create | options, share);
|
|
@@ -314,7 +314,7 @@ static inline void file_attrcopy(PAL_STREAM_ATTR* attr, struct stat* stat) {
|
|
|
|
|
|
/* 'attrquery' operation for file streams */
|
|
/* 'attrquery' operation for file streams */
|
|
static int file_attrquery(const char* type, const char* uri, PAL_STREAM_ATTR* attr) {
|
|
static int file_attrquery(const char* type, const char* uri, PAL_STREAM_ATTR* attr) {
|
|
- if (!strcmp_static(type, "file") && !strcmp_static(type, "dir"))
|
|
|
|
|
|
+ if (strcmp_static(type, "file") && strcmp_static(type, "dir"))
|
|
return -PAL_ERROR_INVAL;
|
|
return -PAL_ERROR_INVAL;
|
|
/* try to do the real open */
|
|
/* try to do the real open */
|
|
int fd = ocall_open(uri, 0, 0);
|
|
int fd = ocall_open(uri, 0, 0);
|
|
@@ -356,7 +356,7 @@ static int file_attrsetbyhdl(PAL_HANDLE handle, PAL_STREAM_ATTR* attr) {
|
|
}
|
|
}
|
|
|
|
|
|
static int file_rename(PAL_HANDLE handle, const char* type, const char* uri) {
|
|
static int file_rename(PAL_HANDLE handle, const char* type, const char* uri) {
|
|
- if (!strcmp_static(type, "file"))
|
|
|
|
|
|
+ if (strcmp_static(type, "file"))
|
|
return -PAL_ERROR_INVAL;
|
|
return -PAL_ERROR_INVAL;
|
|
|
|
|
|
char* tmp = strdup(uri);
|
|
char* tmp = strdup(uri);
|
|
@@ -418,7 +418,7 @@ struct handle_ops file_ops = {
|
|
ended with slashes. dir_open will be called by file_open. */
|
|
ended with slashes. dir_open will be called by file_open. */
|
|
static int dir_open(PAL_HANDLE* handle, const char* type, const char* uri, int access, int share,
|
|
static int dir_open(PAL_HANDLE* handle, const char* type, const char* uri, int access, int share,
|
|
int create, int options) {
|
|
int create, int options) {
|
|
- if (!strcmp_static(type, "dir"))
|
|
|
|
|
|
+ if (strcmp_static(type, "dir"))
|
|
return -PAL_ERROR_INVAL;
|
|
return -PAL_ERROR_INVAL;
|
|
if (!WITHIN_MASK(access, PAL_ACCESS_MASK))
|
|
if (!WITHIN_MASK(access, PAL_ACCESS_MASK))
|
|
return -PAL_ERROR_INVAL;
|
|
return -PAL_ERROR_INVAL;
|
|
@@ -567,7 +567,7 @@ static int dir_delete(PAL_HANDLE handle, int access) {
|
|
}
|
|
}
|
|
|
|
|
|
static int dir_rename(PAL_HANDLE handle, const char* type, const char* uri) {
|
|
static int dir_rename(PAL_HANDLE handle, const char* type, const char* uri) {
|
|
- if (!strcmp_static(type, "dir"))
|
|
|
|
|
|
+ if (strcmp_static(type, "dir"))
|
|
return -PAL_ERROR_INVAL;
|
|
return -PAL_ERROR_INVAL;
|
|
|
|
|
|
char* tmp = strdup(uri);
|
|
char* tmp = strdup(uri);
|