summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
d50f41c)
Although (as of 1.2.11) zlib checks this parameter before writing to
it, the docs don't promise to keep doing so, so be safe.
#include "notmuch-client.h"
#include "hex-escape.h"
#include "string-util.h"
#include "notmuch-client.h"
#include "hex-escape.h"
#include "string-util.h"
static int
database_dump_config (notmuch_database_t *notmuch, gzFile output)
static int
database_dump_config (notmuch_database_t *notmuch, gzFile output)
ret = gzflush (output, Z_FINISH);
if (ret) {
ret = gzflush (output, Z_FINISH);
if (ret) {
- fprintf (stderr, "Error flushing output: %s\n", gzerror (output, NULL));
+ fprintf (stderr, "Error flushing output: %s\n", gzerror_str (output));
ret = gzclose_w (output);
if (ret) {
fprintf (stderr, "Error closing %s: %s\n", name_for_error,
ret = gzclose_w (output);
if (ret) {
fprintf (stderr, "Error closing %s: %s\n", name_for_error,
- gzerror (output, NULL));
ret = EXIT_FAILURE;
output = NULL;
goto DONE;
ret = EXIT_FAILURE;
output = NULL;
goto DONE;
if (input && gzclose_r (input)) {
fprintf (stderr, "Error closing %s: %s\n",
if (input && gzclose_r (input)) {
fprintf (stderr, "Error closing %s: %s\n",
- name_for_error, gzerror (input, NULL));
+ name_for_error, gzerror_str (input));
gz_error_string (util_status_t status, gzFile file)
{
if (status == UTIL_GZERROR)
gz_error_string (util_status_t status, gzFile file)
{
if (status == UTIL_GZERROR)
- return gzerror (file, NULL);
+ return gzerror_str (file);
else
return util_error_string (status);
}
else
return util_error_string (status);
}
const char *
gz_error_string (util_status_t status, gzFile stream);
const char *
gz_error_string (util_status_t status, gzFile stream);
+/* Call gzerror with a dummy errno argument, the docs don't promise to
+ * support the NULL case */
+inline const char *
+gzerror_str(gzFile file) { int dummy; return gzerror (file, &dummy); }
+
#ifdef __cplusplus
}
#endif
#ifdef __cplusplus
}
#endif