From: Michael R Sweet Date: Wed, 7 Apr 2021 13:44:22 +0000 (-0400) Subject: Report an error when the test file cannot be found. X-Git-Tag: v2.4b1~160 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e4ba5f540b9c7ee7ef92a7013ada72fbdce3db89;p=thirdparty%2Fcups.git Report an error when the test file cannot be found. --- diff --git a/CHANGES.md b/CHANGES.md index 9bebc1b7e6..16576f7371 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -8,6 +8,9 @@ CUPS v2.4rc1 (Pending) - Added support for AirPrint and Mopria clients (Issue #105) - Added configure support for specifying systemd dependencies in the CUPS service file (Issue #144) +- Added several features and improvements to `ipptool` (Issue #153) +- The `ipptool` command now correctly reports an error when a test file cannot + be found. - Fixed Kerberos authentication for the web interface (Issue #19) - The ZPL sample driver now supports more "standard" label sizes (Issue #70) - The IPP backend did not return the correct status code when a job was canceled @@ -21,7 +24,6 @@ CUPS v2.4rc1 (Pending) - The USB backend now runs as root (Issue #121) - Added pkg-config file for libcups (Issue #122) - Fixed a PPD memory leak caused by emulator definitions (Issue #124) -- Added several features and improvements to `ipptool` (Issue #153) - The scheduler now includes the `[Job N]` prefix for job log messages, even when using syslog logging (Issue #154) - Added support for locales using the GB18030 character set (Issue #159) diff --git a/tools/ipptool.c b/tools/ipptool.c index 25a34d2b60..5cfdaab342 100644 --- a/tools/ipptool.c +++ b/tools/ipptool.c @@ -681,7 +681,12 @@ main(int argc, /* I - Number of command-line args */ else testfile = argv[i]; - if (!do_tests(testfile, &data)) + if (access(testfile, 0)) + { + _cupsLangPrintf(stderr, _("%s: Unable to open \"%s\": %s"), "ipptool", testfile, strerror(errno)); + status = 1; + } + else if (!do_tests(testfile, &data)) status = 1; } }