catch error from as.*printf

This commit is contained in:
Love Hornquist Astrand
2010-05-30 12:41:06 -07:00
parent f4f59121c3
commit 9773655027
4 changed files with 13 additions and 11 deletions

View File

@@ -38,11 +38,10 @@
ROKEN_LIB_FUNCTION char * ROKEN_LIB_CALL
pid_file_write (const char *progname)
{
char *ret = NULL;
FILE *fp;
char *ret;
asprintf (&ret, "%s%s.pid", _PATH_VARRUN, progname);
if (ret == NULL)
if (asprintf (&ret, "%s%s.pid", _PATH_VARRUN, progname) < 0 || ret == NULL)
return NULL;
fp = fopen (ret, "w");
if (fp == NULL) {