Bug#662083: Bug#766456: libzip: FTBFS on hurd-i386
Source: libzip
Version: 0.11.2-1.1
Severity: important
Tags: patch
User: debian-hurd@lists.debian.org
Usertags: hurd
Hi, as a follow-up and patch for #662083
Currently libzip FTBFS on GNU/Hurd due to one failing test:
open_nosuchfile.test. This test checks for a non-existing file and the
error codes for ENOENT: No such file or directory. On GNU/Linux and
GNU/kFreeBSD this number is 2 in errno.h but for GNU/Hurd it is
1073741826, resulting in a false negative.
The attached patch solves this problem by printing the string "No such
file or directory" in regress/tryopen.c and test for that string in
regress/open_nosuchfile.test instead of printing and testing the error
number.
Successfully built on Linux, kFreeBSD and Hurd.
Thanks!
Index: libzip-0.11.2/regress/tryopen.c
===================================================================
--- libzip-0.11.2.orig/regress/tryopen.c
+++ libzip-0.11.2/regress/tryopen.c
@@ -35,6 +35,7 @@
#include "config.h"
#include <errno.h>
+#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#ifdef HAVE_UNISTD_H
@@ -102,7 +103,7 @@ main(int argc, char *argv[])
printf("opening '%s' returned error %d", fname, ze);
if (zip_error_get_sys_type(ze) == ZIP_ET_SYS)
- printf("/%d", errno);
+ printf("/%s", strerror(errno));
printf("\n");
error++;
}
Index: libzip-0.11.2/regress/open_nosuchfile.test
===================================================================
--- libzip-0.11.2.orig/regress/open_nosuchfile.test
+++ libzip-0.11.2/regress/open_nosuchfile.test
@@ -2,5 +2,5 @@
program tryopen
args nosuchfile
return 1
-stdout opening 'nosuchfile' returned error 11/2
+stdout opening 'nosuchfile' returned error 11/No such file or directory
stderr 1 errors
Reply to: