From 0e1bcf8db5028ba48ac65d44a59d653d9ed5ab7e Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Fri, 16 Jun 2006 11:24:32 +0000 Subject: [PATCH] *** empty log message *** --- ase/awk/extio.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/ase/awk/extio.c b/ase/awk/extio.c index 46907fbe..aceeb474 100644 --- a/ase/awk/extio.c +++ b/ase/awk/extio.c @@ -1,5 +1,5 @@ /* - * $Id: extio.c,v 1.1 2006-06-16 07:35:07 bacon Exp $ + * $Id: extio.c,v 1.2 2006-06-16 11:24:32 bacon Exp $ */ #include @@ -29,7 +29,7 @@ int xp_awk_readcmd (xp_awk_run_t* run, const xp_char_t* cmd, int* errnum) p = (xp_awk_cmd_t*) xp_malloc (xp_sizeof(xp_awk_cmd_t)); if (p == XP_NULL) { - *errnum = XP_AWK_EPIPE; + *errnum = XP_AWK_ENOMEM; return -1; } @@ -37,7 +37,7 @@ int xp_awk_readcmd (xp_awk_run_t* run, const xp_char_t* cmd, int* errnum) if (p->name == XP_NULL) { xp_free (p); - *errnum = XP_AWK_EPIPE; + *errnum = XP_AWK_ENOMEM; return -1; } @@ -49,9 +49,11 @@ int xp_awk_readcmd (xp_awk_run_t* run, const xp_char_t* cmd, int* errnum) if (p->handle == XP_NULL) { p->handle = (void*) _tpopen (p->name, XP_T("r")); - if (p->handle == NULL) + if (p->handle == NULL) { - *errnum = XP_AWK_EPIPE; + /* this is treated as pipe open error. + * the return value of getline should be -1 + */ return -1; } } @@ -62,7 +64,6 @@ int xp_awk_readcmd (xp_awk_run_t* run, const xp_char_t* cmd, int* errnum) xp_printf(XP_TEXT("%s"), buf); } - return 1; }