aboutsummaryrefslogtreecommitdiff
path: root/jerry-libc
diff options
context:
space:
mode:
authorDániel Bátyai <dbatyai@inf.u-szeged.hu>2016-02-24 18:38:27 +0100
committerDániel Bátyai <dbatyai@inf.u-szeged.hu>2016-04-11 14:34:08 +0200
commit764229b26243b49f4544253e8fb5d65039689990 (patch)
tree10006a5fce8f8762d76f6075a981ee5895d5ccfe /jerry-libc
parentb78f5a55bb83f9a431a31a0b88af24df8b67208a (diff)
Fix syscall assertion when input file does not exist
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai@inf.u-szeged.hu
Diffstat (limited to 'jerry-libc')
-rw-r--r--jerry-libc/target/darwin/jerry-libc-target.c33
-rw-r--r--jerry-libc/target/linux/jerry-libc-target.c33
2 files changed, 8 insertions, 58 deletions
diff --git a/jerry-libc/target/darwin/jerry-libc-target.c b/jerry-libc/target/darwin/jerry-libc-target.c
index e09f5a94..fb096c91 100644
--- a/jerry-libc/target/darwin/jerry-libc-target.c
+++ b/jerry-libc/target/darwin/jerry-libc-target.c
@@ -33,15 +33,6 @@
LIBC_UNREACHABLE_STUB_FOR (int raise (int sig_no __attr_unused___))
-/**
- * Exit program with ERR_SYSCALL if syscall_ret_val is negative
- */
-#define LIBC_EXIT_ON_ERROR(syscall_ret_val) \
- if ((syscall_ret_val) < 0) \
-{ \
- libc_fatal ("Syscall", __FILE__, __func__, __LINE__); \
-}
-
static long int syscall_0 (long int syscall_no);
static long int syscall_1 (long int syscall_no, long int arg1);
static long int syscall_2 (long int syscall_no, long int arg1, long int arg2);
@@ -60,11 +51,7 @@ extern long int syscall_3_asm (long int syscall_no, long int arg1, long int arg2
static __attr_noinline___ long int
syscall_0 (long int syscall_no) /**< syscall number */
{
- long int ret = syscall_0_asm (syscall_no);
-
- LIBC_EXIT_ON_ERROR (ret);
-
- return ret;
+ return syscall_0_asm (syscall_no);
} /* syscall_0 */
/**
@@ -76,11 +63,7 @@ static __attr_noinline___ long int
syscall_1 (long int syscall_no, /**< syscall number */
long int arg1) /**< argument */
{
- long int ret = syscall_1_asm (syscall_no, arg1);
-
- LIBC_EXIT_ON_ERROR (ret);
-
- return ret;
+ return syscall_1_asm (syscall_no, arg1);
} /* syscall_1 */
/**
@@ -93,11 +76,7 @@ syscall_2 (long int syscall_no, /**< syscall number */
long int arg1, /**< first argument */
long int arg2) /**< second argument */
{
- long int ret = syscall_2_asm (syscall_no, arg1, arg2);
-
- LIBC_EXIT_ON_ERROR (ret);
-
- return ret;
+ return syscall_2_asm (syscall_no, arg1, arg2);
} /* syscall_2 */
/**
@@ -111,11 +90,7 @@ syscall_3 (long int syscall_no, /**< syscall number */
long int arg2, /**< second argument */
long int arg3) /**< third argument */
{
- long int ret = syscall_3_asm (syscall_no, arg1, arg2, arg3);
-
- LIBC_EXIT_ON_ERROR (ret);
-
- return ret;
+ return syscall_3_asm (syscall_no, arg1, arg2, arg3);
} /* syscall_3 */
/** Output of character. Writes the character c, cast to an unsigned char, to stdout. */
diff --git a/jerry-libc/target/linux/jerry-libc-target.c b/jerry-libc/target/linux/jerry-libc-target.c
index 0821136c..d8202b43 100644
--- a/jerry-libc/target/linux/jerry-libc-target.c
+++ b/jerry-libc/target/linux/jerry-libc-target.c
@@ -33,15 +33,6 @@
LIBC_UNREACHABLE_STUB_FOR (int raise (int sig_no __attr_unused___))
-/**
- * Exit program with ERR_SYSCALL if syscall_ret_val is negative
- */
-#define LIBC_EXIT_ON_ERROR(syscall_ret_val) \
- if ((syscall_ret_val) < 0) \
-{ \
- libc_fatal ("Syscall", __FILE__, __func__, __LINE__); \
-}
-
static long int syscall_0 (long int syscall_no);
static long int syscall_1 (long int syscall_no, long int arg1);
static long int syscall_2 (long int syscall_no, long int arg1, long int arg2);
@@ -60,11 +51,7 @@ extern long int syscall_3_asm (long int syscall_no, long int arg1, long int arg2
static __attr_noinline___ long int
syscall_0 (long int syscall_no) /**< syscall number */
{
- long int ret = syscall_0_asm (syscall_no);
-
- LIBC_EXIT_ON_ERROR (ret);
-
- return ret;
+ return syscall_0_asm (syscall_no);
} /* syscall_0 */
/**
@@ -76,11 +63,7 @@ static __attr_noinline___ long int
syscall_1 (long int syscall_no, /**< syscall number */
long int arg1) /**< argument */
{
- long int ret = syscall_1_asm (syscall_no, arg1);
-
- LIBC_EXIT_ON_ERROR (ret);
-
- return ret;
+ return syscall_1_asm (syscall_no, arg1);
} /* syscall_1 */
/**
@@ -93,11 +76,7 @@ syscall_2 (long int syscall_no, /**< syscall number */
long int arg1, /**< first argument */
long int arg2) /**< second argument */
{
- long int ret = syscall_2_asm (syscall_no, arg1, arg2);
-
- LIBC_EXIT_ON_ERROR (ret);
-
- return ret;
+ return syscall_2_asm (syscall_no, arg1, arg2);
} /* syscall_2 */
/**
@@ -111,11 +90,7 @@ syscall_3 (long int syscall_no, /**< syscall number */
long int arg2, /**< second argument */
long int arg3) /**< third argument */
{
- long int ret = syscall_3_asm (syscall_no, arg1, arg2, arg3);
-
- LIBC_EXIT_ON_ERROR (ret);
-
- return ret;
+ return syscall_3_asm (syscall_no, arg1, arg2, arg3);
} /* syscall_3 */
/** Output of character. Writes the character c, cast to an unsigned char, to stdout. */