Replace /*PRINTFLIKEn*/ with attribute(printf)

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Issue #12201
This commit is contained in:
наб
2021-06-05 13:14:12 +02:00
committed by Brian Behlendorf
parent 1373709450
commit 5dbf6c5a66
19 changed files with 76 additions and 164 deletions
+6 -8
View File
@@ -69,8 +69,7 @@
#include "zutil_import.h"
/*PRINTFLIKE2*/
static void
static __attribute__((format(printf, 2, 3))) void
zutil_error_aux(libpc_handle_t *hdl, const char *fmt, ...)
{
va_list ap;
@@ -104,8 +103,7 @@ zutil_verror(libpc_handle_t *hdl, const char *error, const char *fmt,
}
}
/*PRINTFLIKE3*/
static int
static __attribute__((format(printf, 3, 4))) int
zutil_error_fmt(libpc_handle_t *hdl, const char *error, const char *fmt, ...)
{
va_list ap;
@@ -1237,7 +1235,7 @@ zpool_find_import_scan_dir(libpc_handle_t *hdl, pthread_mutex_t *lock,
if (error == ENOENT)
return (0);
zutil_error_aux(hdl, strerror(error));
zutil_error_aux(hdl, "%s", strerror(error));
(void) zutil_error_fmt(hdl, EZFS_BADPATH, dgettext(
TEXT_DOMAIN, "cannot resolve path '%s'"), dir);
return (error);
@@ -1246,7 +1244,7 @@ zpool_find_import_scan_dir(libpc_handle_t *hdl, pthread_mutex_t *lock,
dirp = opendir(path);
if (dirp == NULL) {
error = errno;
zutil_error_aux(hdl, strerror(error));
zutil_error_aux(hdl, "%s", strerror(error));
(void) zutil_error_fmt(hdl, EZFS_BADPATH,
dgettext(TEXT_DOMAIN, "cannot open '%s'"), path);
return (error);
@@ -1308,7 +1306,7 @@ zpool_find_import_scan_path(libpc_handle_t *hdl, pthread_mutex_t *lock,
goto out;
}
zutil_error_aux(hdl, strerror(error));
zutil_error_aux(hdl, "%s", strerror(error));
(void) zutil_error_fmt(hdl, EZFS_BADPATH, dgettext(
TEXT_DOMAIN, "cannot resolve path '%s'"), dir);
goto out;
@@ -1346,7 +1344,7 @@ zpool_find_import_scan(libpc_handle_t *hdl, pthread_mutex_t *lock,
if (error == ENOENT)
continue;
zutil_error_aux(hdl, strerror(error));
zutil_error_aux(hdl, "%s", strerror(error));
(void) zutil_error_fmt(hdl, EZFS_BADPATH, dgettext(
TEXT_DOMAIN, "cannot resolve path '%s'"), dir[i]);
goto error;