1
0
mirror of git://projects.qi-hardware.com/fped.git synced 2024-11-22 13:04:04 +02:00

hack: set errno to ENOENT when -1 fails, so that the error isn't too ugly

The caller assumes that any error would be signaled via errno. A proper
solution would be to allow also for non-errno errors.



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@6004 99fdad57-331a-0410-800a-d7fa5415bdb3
This commit is contained in:
werner 2011-03-23 08:07:31 +00:00
parent f44accdad7
commit 2de385e9c7

View File

@ -14,6 +14,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <errno.h>
#include "util.h" #include "util.h"
#include "coord.h" #include "coord.h"
@ -1095,6 +1096,7 @@ static int ps_for_all_pkg(FILE *file,
pages++; pages++;
if (one && !pages) { if (one && !pages) {
fprintf(stderr, "no package \"%s\" to select\n", one); fprintf(stderr, "no package \"%s\" to select\n", one);
errno = ENOENT;
return 0; return 0;
} }
prologue(file, pages); prologue(file, pages);