mirror of
https://github.com/jerryscript-project/jerryscript.git
synced 2025-12-15 16:29:21 +00:00
Fix fopen call on non-existing files. (#1442)
The main implementation of unix platform hangs, if the engine was built with jerry-libc. Open system call returns with a negative error code if cannot open the file, but fopen must return NULL when error happens. Fixes #1437. JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
This commit is contained in:
parent
6ac0a39519
commit
4a0f78bc4b
@ -178,7 +178,7 @@ fopen (const char *path, /**< file path */
|
||||
|
||||
long int ret = syscall_3 (SYSCALL_NO (open), (long int) path, flags, access);
|
||||
|
||||
return (void *) (uintptr_t) (ret);
|
||||
return ((ret < 0) ? NULL : (void *) (uintptr_t) (ret));
|
||||
} /* fopen */
|
||||
|
||||
/**
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user