summaryrefslogtreecommitdiff
path: root/usr/src/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/cmd')
-rw-r--r--usr/src/cmd/bhyve/Makefile3
-rw-r--r--usr/src/cmd/mdb/intel/mdb/mdb_bhyve.c48
-rw-r--r--usr/src/cmd/ndmpd/include/tlm.h12
-rw-r--r--usr/src/cmd/ndmpd/ndmp/ndmpd.h6
-rw-r--r--usr/src/cmd/ndmpd/ndmp/ndmpd_common.h6
-rw-r--r--usr/src/cmd/ndmpd/ndmp/ndmpd_data.c15
-rw-r--r--usr/src/cmd/ndmpd/ndmp/ndmpd_mover.c52
-rw-r--r--usr/src/cmd/ndmpd/ndmp/ndmpd_tar.c37
-rw-r--r--usr/src/cmd/ndmpd/ndmp/ndmpd_tar3.c50
-rw-r--r--usr/src/cmd/ndmpd/ndmp/ndmpd_zfs.c89
-rw-r--r--usr/src/cmd/ndmpd/tlm/tlm_proto.h6
-rw-r--r--usr/src/cmd/ndmpd/tlm/tlm_restore_writer.c21
-rw-r--r--usr/src/cmd/varpd/varpd.c2
-rw-r--r--usr/src/cmd/zoneadmd/zfd.c2
-rw-r--r--usr/src/cmd/zoneadmd/zoneadmd.c5
15 files changed, 182 insertions, 172 deletions
diff --git a/usr/src/cmd/bhyve/Makefile b/usr/src/cmd/bhyve/Makefile
index ea4537596a..740cd2679a 100644
--- a/usr/src/cmd/bhyve/Makefile
+++ b/usr/src/cmd/bhyve/Makefile
@@ -125,6 +125,9 @@ CPPFLAGS = -I$(COMPAT)/freebsd -I$(CONTRIB)/freebsd \
-DWITHOUT_CAPSICUM
pci_nvme.o := CERRWARN += -_gcc=-Wno-pointer-sign
+pci_nvme.o := CERRWARN += -_gcc9=-Wno-address-of-packed-member
+pci_passthru.o := CERRWARN += -_gcc9=-Wno-address-of-packed-member
+pci_xhci.o := CERRWARN += -_gcc9=-Wno-address-of-packed-member
SMOFF += all_func_returns,leaks,no_if_block
diff --git a/usr/src/cmd/mdb/intel/mdb/mdb_bhyve.c b/usr/src/cmd/mdb/intel/mdb/mdb_bhyve.c
index 9477bf5056..fa098c106e 100644
--- a/usr/src/cmd/mdb/intel/mdb/mdb_bhyve.c
+++ b/usr/src/cmd/mdb/intel/mdb/mdb_bhyve.c
@@ -1370,15 +1370,15 @@ bhyve_putareg(mdb_tgt_t *tgt, mdb_tgt_tid_t tid, const char *rname,
static const mdb_tgt_ops_t bhyve_ops = {
.t_setflags = bhyve_setflags,
- .t_setcontext = (int (*)()) mdb_tgt_notsup,
+ .t_setcontext = (void *)mdb_tgt_notsup,
.t_activate = bhyve_activate,
.t_deactivate = bhyve_deactivate,
- .t_periodic = (void (*)()) mdb_tgt_nop,
+ .t_periodic = (void *)mdb_tgt_nop,
.t_destroy = bhyve_destroy,
.t_name = bhyve_name,
.t_isa = bhyve_isa,
- .t_platform = (const char *(*)()) mdb_conf_platform,
- .t_uname = (int (*)()) mdb_tgt_notsup,
+ .t_platform = (void *)mdb_conf_platform,
+ .t_uname = (void *)mdb_tgt_notsup,
.t_dmodel = bhyve_dmodel,
.t_aread = bhyve_aread,
.t_awrite = bhyve_awrite,
@@ -1391,35 +1391,35 @@ static const mdb_tgt_ops_t bhyve_ops = {
.t_ioread = bhyve_ioread,
.t_iowrite = bhyve_iowrite,
.t_vtop = bhyve_vtop,
- .t_lookup_by_name = (int (*)()) mdb_tgt_notsup,
- .t_lookup_by_addr = (int (*)()) mdb_tgt_notsup,
- .t_symbol_iter = (int (*)()) mdb_tgt_notsup,
- .t_mapping_iter = (int (*)()) mdb_tgt_notsup,
- .t_object_iter = (int (*)()) mdb_tgt_notsup,
+ .t_lookup_by_name = (void *)mdb_tgt_notsup,
+ .t_lookup_by_addr = (void *)mdb_tgt_notsup,
+ .t_symbol_iter = (void *)mdb_tgt_notsup,
+ .t_mapping_iter = (void *)mdb_tgt_notsup,
+ .t_object_iter = (void *)mdb_tgt_notsup,
.t_addr_to_map = (const mdb_map_t *(*)()) mdb_tgt_null,
.t_name_to_map = (const mdb_map_t *(*)()) mdb_tgt_null,
.t_addr_to_ctf = (struct ctf_file *(*)()) mdb_tgt_null,
.t_name_to_ctf = (struct ctf_file *(*)()) mdb_tgt_null,
.t_status = bhyve_status,
- .t_run = (int (*)()) mdb_tgt_notsup,
+ .t_run = (void *)mdb_tgt_notsup,
.t_step = bhyve_step,
- .t_step_out = (int (*)()) mdb_tgt_notsup,
- .t_next = (int (*)()) mdb_tgt_notsup,
+ .t_step_out = (void *)mdb_tgt_notsup,
+ .t_next = (void *)mdb_tgt_notsup,
.t_cont = bhyve_cont,
- .t_signal = (int (*)()) mdb_tgt_notsup,
- .t_add_vbrkpt = (int (*)()) mdb_tgt_null,
- .t_add_sbrkpt = (int (*)()) mdb_tgt_null,
- .t_add_pwapt = (int (*)()) mdb_tgt_null,
- .t_add_vwapt = (int (*)()) mdb_tgt_null,
- .t_add_iowapt = (int (*)()) mdb_tgt_null,
- .t_add_sysenter = (int (*)()) mdb_tgt_null,
- .t_add_sysexit = (int (*)()) mdb_tgt_null,
- .t_add_signal = (int (*)()) mdb_tgt_null,
- .t_add_fault = (int (*)()) mdb_tgt_null,
+ .t_signal = (void *)mdb_tgt_notsup,
+ .t_add_vbrkpt = (void *)mdb_tgt_null,
+ .t_add_sbrkpt = (void *)mdb_tgt_null,
+ .t_add_pwapt = (void *)mdb_tgt_null,
+ .t_add_vwapt = (void *)mdb_tgt_null,
+ .t_add_iowapt = (void *)mdb_tgt_null,
+ .t_add_sysenter = (void *)mdb_tgt_null,
+ .t_add_sysexit = (void *)mdb_tgt_null,
+ .t_add_signal = (void *)mdb_tgt_null,
+ .t_add_fault = (void *)mdb_tgt_null,
.t_getareg = bhyve_getareg,
.t_putareg = bhyve_putareg,
- .t_stack_iter = (int (*)()) mdb_tgt_notsup,
- .t_auxv = (int (*)()) mdb_tgt_notsup
+ .t_stack_iter = (void *)mdb_tgt_notsup,
+ .t_auxv = (void *)mdb_tgt_notsup
};
int
diff --git a/usr/src/cmd/ndmpd/include/tlm.h b/usr/src/cmd/ndmpd/include/tlm.h
index f382d2eca3..8c667a334b 100644
--- a/usr/src/cmd/ndmpd/include/tlm.h
+++ b/usr/src/cmd/ndmpd/include/tlm.h
@@ -11,10 +11,10 @@
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- * - Redistributions of source code must retain the above copyright
+ * - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
- * - Redistributions in binary form must reproduce the above copyright
+ * - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
@@ -113,9 +113,9 @@ typedef struct fs_fhandle {
} fs_fhandle_t;
typedef struct scsi_link {
- struct scsi_link *sl_next;
- struct scsi_link *sl_prev;
- struct scsi_adapter *sl_sa;
+ struct scsi_link *sl_next;
+ struct scsi_link *sl_prev;
+ struct scsi_adapter *sl_sa;
unsigned int sl_sid;
unsigned int sl_lun;
unsigned int sl_requested_max_active;
@@ -427,7 +427,7 @@ typedef struct tm_ops {
int (*tm_putfile)();
int (*tm_putdir)();
int (*tm_putvol)(); /* Reserved */
- int (*tm_getfile)();
+ void * (*tm_getfile)(void *);
int (*tm_getdir)();
int (*tm_getvol)(); /* Reserved */
} tm_ops_t;
diff --git a/usr/src/cmd/ndmpd/ndmp/ndmpd.h b/usr/src/cmd/ndmpd/ndmp/ndmpd.h
index 4f9fcd9a09..929a833c1c 100644
--- a/usr/src/cmd/ndmpd/ndmp/ndmpd.h
+++ b/usr/src/cmd/ndmpd/ndmp/ndmpd.h
@@ -11,10 +11,10 @@
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- * - Redistributions of source code must retain the above copyright
+ * - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
- * - Redistributions in binary form must reproduce the above copyright
+ * - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
@@ -998,7 +998,7 @@ extern int ndmp_backup_extract_params(ndmpd_session_t *,
ndmpd_module_params_t *);
extern int ndmp_restore_extract_params(ndmpd_session_t *,
ndmpd_module_params_t *);
-extern int ndmp_tar_reader(ndmp_tar_reader_arg_t *);
+extern void *ndmp_tar_reader(void *);
extern int tape_open(char *, int);
extern int tape_is_at_bot(ndmpd_session_t *);
diff --git a/usr/src/cmd/ndmpd/ndmp/ndmpd_common.h b/usr/src/cmd/ndmpd/ndmp/ndmpd_common.h
index 846f64e66f..383d5a673c 100644
--- a/usr/src/cmd/ndmpd/ndmp/ndmpd_common.h
+++ b/usr/src/cmd/ndmpd/ndmp/ndmpd_common.h
@@ -10,10 +10,10 @@
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- * - Redistributions of source code must retain the above copyright
+ * - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
- * - Redistributions in binary form must reproduce the above copyright
+ * - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
@@ -281,6 +281,6 @@ extern int ndmp_log_msg_id;
/*
* Module function prototypes.
*/
-typedef int module_start_func_t(void *);
+typedef void *module_start_func_t(void *);
typedef int module_abort_func_t(void *);
#endif /* _NDMP_COMMON_H */
diff --git a/usr/src/cmd/ndmpd/ndmp/ndmpd_data.c b/usr/src/cmd/ndmpd/ndmp/ndmpd_data.c
index 9350cb05f7..2713f8bec2 100644
--- a/usr/src/cmd/ndmpd/ndmp/ndmpd_data.c
+++ b/usr/src/cmd/ndmpd/ndmp/ndmpd_data.c
@@ -11,10 +11,10 @@
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- * - Redistributions of source code must retain the above copyright
+ * - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
- * - Redistributions in binary form must reproduce the above copyright
+ * - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
@@ -1466,7 +1466,7 @@ ndmpd_tar_start_backup_v3(ndmpd_session_t *session, char *bu_type,
* client request here.
*/
err = pthread_create(NULL, NULL,
- (funct_t)session->ns_data.dd_module.dm_start_func,
+ session->ns_data.dd_module.dm_start_func,
params);
if (err != 0) {
NDMP_LOG(LOG_ERR, "Can't start backup session.");
@@ -1595,7 +1595,7 @@ ndmpd_tar_start_recover_v3(ndmpd_session_t *session,
* client request here.
*/
err = pthread_create(NULL, NULL,
- (funct_t)session->ns_data.dd_module.dm_start_func,
+ session->ns_data.dd_module.dm_start_func,
params);
if (err != 0) {
@@ -1692,7 +1692,8 @@ ndmpd_zfs_start_op(ndmpd_session_t *session, ndmp_pval *env_val,
}
err = pthread_create(&tid, NULL,
- (funct_t)session->ns_data.dd_module.dm_start_func, ndmpd_zfs_args);
+ session->ns_data.dd_module.dm_start_func,
+ ndmpd_zfs_args);
if (err) {
NDMP_LOG(LOG_ERR, "Can't start %s session (errno %d)",
@@ -2185,7 +2186,7 @@ ndmpd_tar_start_backup_v2(ndmpd_session_t *session, char *bu_type,
* client request here.
*/
(void) pthread_create(NULL, NULL,
- (funct_t)session->ns_data.dd_module.dm_start_func,
+ session->ns_data.dd_module.dm_start_func,
params);
return (NDMP_NO_ERR);
@@ -2322,7 +2323,7 @@ ndmpd_tar_start_recover_v2(ndmpd_session_t *session, char *bu_type,
* client request here.
*/
(void) pthread_create(NULL, NULL,
- (funct_t)session->ns_data.dd_module.dm_start_func,
+ session->ns_data.dd_module.dm_start_func,
params);
return (NDMP_NO_ERR);
diff --git a/usr/src/cmd/ndmpd/ndmp/ndmpd_mover.c b/usr/src/cmd/ndmpd/ndmp/ndmpd_mover.c
index 2f7f311e75..8428679e93 100644
--- a/usr/src/cmd/ndmpd/ndmp/ndmpd_mover.c
+++ b/usr/src/cmd/ndmpd/ndmp/ndmpd_mover.c
@@ -10,10 +10,10 @@
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- * - Redistributions of source code must retain the above copyright
+ * - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
- * - Redistributions in binary form must reproduce the above copyright
+ * - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
@@ -2503,8 +2503,8 @@ mover_tape_read_one_buf(ndmpd_session_t *session, tlm_buffer_t *buf)
* 0: on success
* -1: otherwise
*/
-int
-mover_tape_reader(ndmpd_session_t *session)
+void *
+mover_tape_reader(void *ptr)
{
int bidx; /* buffer index */
int rv;
@@ -2513,10 +2513,11 @@ mover_tape_reader(ndmpd_session_t *session)
tlm_buffers_t *bufs;
tlm_cmd_t *lcmd; /* Local command */
tlm_commands_t *cmds; /* Commands structure */
+ ndmpd_session_t *session = ptr;
if ((nlp = ndmp_get_nlp(session)) == NULL) {
NDMP_LOG(LOG_DEBUG, "nlp == NULL");
- return (-1);
+ return ((void *)(uintptr_t)-1);
}
cmds = &nlp->nlp_cmds;
@@ -2582,7 +2583,7 @@ mover_tape_reader(ndmpd_session_t *session)
cmds->tcs_reader_count--;
lcmd->tc_ref--;
lcmd->tc_writer = TLM_STOP;
- return (0);
+ return (NULL);
}
@@ -2652,8 +2653,8 @@ mover_socket_write_one_buf(ndmpd_session_t *session, tlm_buffer_t *buf)
* 0: on success
* -1: otherwise
*/
-int
-mover_socket_writer(ndmpd_session_t *session)
+void *
+mover_socket_writer(void *ptr)
{
int bidx; /* buffer index */
ndmp_lbr_params_t *nlp;
@@ -2661,10 +2662,11 @@ mover_socket_writer(ndmpd_session_t *session)
tlm_buffers_t *bufs;
tlm_cmd_t *lcmd; /* Local command */
tlm_commands_t *cmds; /* Commands structure */
+ ndmpd_session_t *session = ptr;
if ((nlp = ndmp_get_nlp(session)) == NULL) {
NDMP_LOG(LOG_DEBUG, "nlp == NULL");
- return (-1);
+ return ((void *)(uintptr_t)-1);
}
cmds = &nlp->nlp_cmds;
@@ -2725,7 +2727,7 @@ mover_socket_writer(ndmpd_session_t *session)
cmds->tcs_writer_count--;
lcmd->tc_ref--;
lcmd->tc_reader = TLM_STOP;
- return (0);
+ return (NULL);
}
@@ -2772,7 +2774,7 @@ start_mover_for_restore(ndmpd_session_t *session)
* must be sent to the client before probable errors are sent
* to the client.
*/
- rc = pthread_create(NULL, NULL, (funct_t)mover_tape_reader, session);
+ rc = pthread_create(NULL, NULL, mover_tape_reader, session);
if (rc == 0) {
tlm_cmd_wait(cmds->tcs_command, TLM_TAPE_READER);
} else {
@@ -2781,7 +2783,7 @@ start_mover_for_restore(ndmpd_session_t *session)
return (-1);
}
- rc = pthread_create(NULL, NULL, (funct_t)mover_socket_writer, session);
+ rc = pthread_create(NULL, NULL, mover_socket_writer, session);
if (rc == 0) {
tlm_cmd_wait(cmds->tcs_command, TLM_SOCK_WRITER);
} else {
@@ -2874,8 +2876,8 @@ mover_socket_read_one_buf(ndmpd_session_t *session, tlm_buffer_t *buf,
* 0: on success
* -1: otherwise
*/
-int
-mover_socket_reader(ndmpd_session_t *session)
+void *
+mover_socket_reader(void *ptr)
{
int bidx; /* buffer index */
ndmp_lbr_params_t *nlp;
@@ -2883,11 +2885,12 @@ mover_socket_reader(ndmpd_session_t *session)
tlm_buffers_t *bufs;
tlm_cmd_t *lcmd; /* Local command */
tlm_commands_t *cmds; /* Commands structure */
+ ndmpd_session_t *session = ptr;
static int nr = 0;
if ((nlp = ndmp_get_nlp(session)) == NULL) {
NDMP_LOG(LOG_DEBUG, "nlp == NULL");
- return (-1);
+ return ((void *)(uintptr_t)-1);
}
cmds = &nlp->nlp_cmds;
@@ -2951,7 +2954,7 @@ mover_socket_reader(ndmpd_session_t *session)
cmds->tcs_reader_count--;
lcmd->tc_ref--;
lcmd->tc_writer = TLM_STOP;
- return (0);
+ return (NULL);
}
@@ -3014,8 +3017,8 @@ mover_tape_write_one_buf(ndmpd_session_t *session, tlm_buffer_t *buf)
* 0: on success
* -1: otherwise
*/
-int
-mover_tape_writer(ndmpd_session_t *session)
+void *
+mover_tape_writer(void *ptr)
{
int bidx;
ndmp_lbr_params_t *nlp;
@@ -3023,11 +3026,12 @@ mover_tape_writer(ndmpd_session_t *session)
tlm_buffers_t *bufs;
tlm_cmd_t *lcmd;
tlm_commands_t *cmds;
+ ndmpd_session_t *session = ptr;
static int nw = 0;
if ((nlp = ndmp_get_nlp(session)) == NULL) {
NDMP_LOG(LOG_DEBUG, "nlp == NULL");
- return (-1);
+ return ((void *)(uintptr_t)-1);
}
cmds = &nlp->nlp_cmds;
@@ -3096,7 +3100,7 @@ mover_tape_writer(ndmpd_session_t *session)
cmds->tcs_writer_count--;
lcmd->tc_ref--;
lcmd->tc_reader = TLM_STOP;
- return (0);
+ return (NULL);
}
@@ -3143,7 +3147,7 @@ start_mover_for_backup(ndmpd_session_t *session)
* must be sent to the client before probable errors are sent
* to the client.
*/
- rc = pthread_create(NULL, NULL, (funct_t)mover_socket_reader, session);
+ rc = pthread_create(NULL, NULL, mover_socket_reader, session);
if (rc == 0) {
tlm_cmd_wait(cmds->tcs_command, TLM_SOCK_READER);
} else {
@@ -3152,7 +3156,7 @@ start_mover_for_backup(ndmpd_session_t *session)
return (-1);
}
- rc = pthread_create(NULL, NULL, (funct_t)mover_tape_writer, session);
+ rc = pthread_create(NULL, NULL, mover_tape_writer, session);
if (rc == 0) {
tlm_cmd_wait(cmds->tcs_command, TLM_TAPE_WRITER);
} else {
@@ -3180,7 +3184,7 @@ start_mover_for_backup(ndmpd_session_t *session)
* Note: non-zero is also returned if the backup type is
* neither TAR nor DUMP. I.e. the is_writer_running()
* check does not apply in this case and things should
- * appear successful.
+ * appear successful.
*/
static boolean_t
is_writer_running(ndmpd_session_t *session)
@@ -3216,7 +3220,7 @@ is_writer_running(ndmpd_session_t *session)
* Note: non-zero is also returned if the backup type is
* neither TAR nor DUMP. I.e. the is_writer_running()
* check does not apply in this case and things should
- * appear successful.
+ * appear successful.
*/
static boolean_t
is_writer_running_v3(ndmpd_session_t *session)
diff --git a/usr/src/cmd/ndmpd/ndmp/ndmpd_tar.c b/usr/src/cmd/ndmpd/ndmp/ndmpd_tar.c
index 8040355eb0..89dc343051 100644
--- a/usr/src/cmd/ndmpd/ndmp/ndmpd_tar.c
+++ b/usr/src/cmd/ndmpd/ndmp/ndmpd_tar.c
@@ -10,10 +10,10 @@
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- * - Redistributions of source code must retain the above copyright
+ * - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
- * - Redistributions in binary form must reproduce the above copyright
+ * - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
@@ -370,8 +370,7 @@ ndmp_write_utf8magic(tlm_cmd_t *cmd)
*
*/
static boolean_t
-timecmp(bk_selector_t *bksp,
- struct stat64 *attr)
+timecmp(bk_selector_t *bksp, struct stat64 *attr)
{
ndmp_lbr_params_t *nlp;
@@ -476,7 +475,7 @@ get_dir_acl_info(char *dir, tlm_acls_t *tlm_acls, tlm_job_stats_t *js)
char *spot;
char *fil;
acl_t *aclp = NULL;
- char *acltp;
+ char *acltp;
checkpointed_dir = ndmp_malloc(TLM_MAX_PATH_NAME);
if (checkpointed_dir == NULL)
@@ -656,7 +655,7 @@ backup_work(char *bk_path, tlm_job_stats_t *job_stats,
longlong_t fsize;
bk_selector_t bks;
tlm_cmd_t *local_commands;
- long dpos;
+ long dpos;
NDMP_LOG(LOG_DEBUG, "nr_chkpnted %d nr_ldate: %u bk_path: \"%s\"",
NLP_ISCHKPNTED(nlp), nlp->nlp_ldate, bk_path);
@@ -1067,8 +1066,8 @@ read_one_buf(ndmpd_module_params_t *mod_params, tlm_buffers_t *bufs,
* file from the tape and wakes up the consumer thread to extract
* it on the disk
*/
-int
-ndmp_tar_reader(ndmp_tar_reader_arg_t *argp)
+void *
+ndmp_tar_reader(void *ptr)
{
int bidx;
int err;
@@ -1078,9 +1077,10 @@ ndmp_tar_reader(ndmp_tar_reader_arg_t *argp)
ndmpd_session_t *session;
ndmpd_module_params_t *mod_params;
tlm_commands_t *cmds;
+ ndmp_tar_reader_arg_t *argp = ptr;
if (!argp)
- return (-1);
+ return ((void *)(uintptr_t)-1);
session = argp->tr_session;
mod_params = argp->tr_mod_params;
@@ -1097,7 +1097,7 @@ ndmp_tar_reader(ndmp_tar_reader_arg_t *argp)
if (err != 0) {
tlm_cmd_signal(cmds->tcs_command, TLM_TAR_READER);
- return (err);
+ return ((void *)(uintptr_t)err);
}
lcmd = cmds->tcs_command;
@@ -1160,7 +1160,7 @@ ndmp_tar_reader(ndmp_tar_reader_arg_t *argp)
*/
cmds->tcs_reader_count--;
lcmd->tc_ref--;
- return (err);
+ return ((void *)(uintptr_t)err);
}
@@ -1314,8 +1314,7 @@ ndmpd_tar_restore(ndmpd_session_t *session, ndmpd_module_params_t *mod_params,
arg.tr_mod_params = mod_params;
arg.tr_cmds = cmds;
- err = pthread_create(&rdtp, NULL, (funct_t)ndmp_tar_reader,
- (void *)&arg);
+ err = pthread_create(&rdtp, NULL, ndmp_tar_reader, &arg);
if (err == 0) {
tlm_cmd_wait(cmds->tcs_command, TLM_TAR_READER);
} else {
@@ -1346,8 +1345,8 @@ ndmpd_tar_restore(ndmpd_session_t *session, ndmpd_module_params_t *mod_params,
if (tm_tar_ops.tm_getfile != NULL) {
- err = pthread_create(&wrtp, NULL,
- (funct_t)tm_tar_ops.tm_getfile, (void *)&tlm_arg);
+ err = pthread_create(&wrtp, NULL, tm_tar_ops.tm_getfile,
+ &tlm_arg);
} else {
(void) pthread_barrier_destroy(&tlm_arg.ba_barrier);
NDMP_LOG(LOG_DEBUG,
@@ -1859,7 +1858,7 @@ ndmp_restore_extract_params(ndmpd_session_t *session,
* and calls ndmp_tar_backup to perform the actual backup. It does the cleanup
* and release the snapshot at the end.
*/
-int
+void *
ndmpd_tar_backup_starter(void *arg)
{
ndmpd_module_params_t *mod_params = arg;
@@ -1933,7 +1932,7 @@ ndmpd_tar_backup_starter(void *arg)
NS_DEC(nbk);
ndmp_session_unref(session);
- return (err);
+ return ((void *)(uintptr_t)err);
}
@@ -1966,7 +1965,7 @@ ndmpd_tar_backup_abort(void *module_cookie)
* Starts the restore by running ndmpd_tar_restore function (V2 only)
*/
-int
+void *
ndmpd_tar_restore_starter(void *arg)
{
ndmpd_module_params_t *mod_params = arg;
@@ -1986,7 +1985,7 @@ ndmpd_tar_restore_starter(void *arg)
NS_DEC(nrs);
ndmp_session_unref(session);
- return (err);
+ return ((void *)(uintptr_t)err);
}
diff --git a/usr/src/cmd/ndmpd/ndmp/ndmpd_tar3.c b/usr/src/cmd/ndmpd/ndmp/ndmpd_tar3.c
index d3e89d5a3d..001368ac44 100644
--- a/usr/src/cmd/ndmpd/ndmp/ndmpd_tar3.c
+++ b/usr/src/cmd/ndmpd/ndmp/ndmpd_tar3.c
@@ -10,10 +10,10 @@
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- * - Redistributions of source code must retain the above copyright
+ * - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
- * - Redistributions in binary form must reproduce the above copyright
+ * - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
@@ -2222,8 +2222,8 @@ lbrbk_v3(void *arg, fst_node_t *pnp, fst_node_t *enp)
* 0: on success
* != 0: otherwise
*/
-static int
-backup_reader_v3(backup_reader_arg_t *argp)
+static void *
+backup_reader_v3(void *ptr)
{
int rv;
tlm_cmd_t *lcmd;
@@ -2234,9 +2234,10 @@ backup_reader_v3(backup_reader_arg_t *argp)
char *jname;
ndmp_lbr_params_t *nlp;
tlm_commands_t *cmds;
+ backup_reader_arg_t *argp = ptr;
if (!argp)
- return (-1);
+ return ((void *)(uintptr_t)-1);
jname = argp->br_jname;
nlp = argp->br_nlp;
@@ -2265,7 +2266,7 @@ backup_reader_v3(backup_reader_arg_t *argp)
bp.bp_tmp = ndmp_malloc(sizeof (char) * TLM_MAX_PATH_NAME);
if (!bp.bp_tmp)
- return (-1);
+ return ((void *)(uintptr_t)-1);
/*
* Make the checkpointed paths for traversing the
@@ -2277,7 +2278,7 @@ backup_reader_v3(backup_reader_arg_t *argp)
bp.bp_chkpnm = ndmp_malloc(sizeof (char) * TLM_MAX_PATH_NAME);
if (!bp.bp_chkpnm) {
NDMP_FREE(bp.bp_tmp);
- return (-1);
+ return ((void *)(uintptr_t)-1);
}
(void) tlm_build_snapshot_name(nlp->nlp_backup_path,
bp.bp_chkpnm, nlp->nlp_jstat->js_job_name);
@@ -2341,8 +2342,7 @@ backup_reader_v3(backup_reader_arg_t *argp)
lcmd->tc_writer = TLM_STOP;
tlm_release_reader_writer_ipc(lcmd);
tlm_un_ref_job_stats(jname);
- return (rv);
-
+ return ((void *)(uintptr_t)rv);
}
@@ -2438,8 +2438,7 @@ tar_backup_v3(ndmpd_session_t *session, ndmpd_module_params_t *params,
(void) pthread_barrier_init(&arg.br_barrier, 0, 2);
- err = pthread_create(&rdtp, NULL, (funct_t)backup_reader_v3,
- (void *)&arg);
+ err = pthread_create(&rdtp, NULL, backup_reader_v3, &arg);
if (err == 0) {
(void) pthread_barrier_wait(&arg.br_barrier);
(void) pthread_barrier_destroy(&arg.br_barrier);
@@ -2512,9 +2511,10 @@ backup_out:
* Find the estimate of backup size. This is used to get an estimate
* of the progress of backup during NDMP backup.
*/
-void
-get_backup_size(ndmp_bkup_size_arg_t *sarg)
+void *
+get_backup_size(void *ptr)
{
+ ndmp_bkup_size_arg_t *sarg = ptr;
fs_traverse_t ft;
u_longlong_t bk_size;
char spath[PATH_MAX];
@@ -2543,6 +2543,7 @@ get_backup_size(ndmp_bkup_size_arg_t *sarg)
bk_size, bk_size / 1024, bk_size /(1024 * 1024));
}
sarg->bs_session->ns_data.dd_data_size = bk_size;
+ return (NULL);
}
/*
@@ -3186,8 +3187,7 @@ ndmpd_dar_tar_v3(ndmpd_session_t *session, ndmpd_module_params_t *params,
arg.tr_mod_params = params;
arg.tr_cmds = cmds;
- err = pthread_create(&rdtp, NULL, (funct_t)ndmp_tar_reader,
- (void *)&arg);
+ err = pthread_create(&rdtp, NULL, ndmp_tar_reader, &arg);
if (err == 0) {
tlm_cmd_wait(cmds->tcs_command, TLM_TAR_READER);
} else {
@@ -3445,8 +3445,8 @@ ndmp_plugin_pre_restore(ndmp_context_t *ctxp, ndmpd_module_params_t *params,
* /link-to-backup-path -> /backup/path
*
* Returns:
- * Pointer to the new path (allocated)
- * NULL if the path doesnt exist
+ * Pointer to the new path (allocated)
+ * NULL if the path doesnt exist
*/
static char *
get_absolute_path(const char *bkpath)
@@ -3548,8 +3548,7 @@ ndmpd_rs_sar_tar_v3(ndmpd_session_t *session, ndmpd_module_params_t *params,
arg.tr_session = session;
arg.tr_mod_params = params;
arg.tr_cmds = cmds;
- err = pthread_create(&rdtp, NULL, (funct_t)ndmp_tar_reader,
- (void *)&arg);
+ err = pthread_create(&rdtp, NULL, ndmp_tar_reader, &arg);
if (err == 0) {
tlm_cmd_wait(cmds->tcs_command, TLM_TAR_READER);
} else {
@@ -3746,7 +3745,7 @@ ndmp_backup_get_params_v3(ndmpd_session_t *session,
* 0: on success
* != 0: otherwise
*/
-int
+void *
ndmpd_tar_backup_starter_v3(void *arg)
{
ndmpd_module_params_t *params = arg;
@@ -3780,8 +3779,7 @@ ndmpd_tar_backup_starter_v3(void *arg)
sarg.bs_path = nlp->nlp_backup_path;
/* Get an estimate of the data size */
- if (pthread_create(&tid, NULL, (funct_t)get_backup_size,
- (void *)&sarg) == 0)
+ if (pthread_create(&tid, NULL, get_backup_size, &sarg) == 0)
(void) pthread_detach(tid);
err = ndmp_get_cur_bk_time(nlp, &nlp->nlp_cdate, jname);
@@ -3810,8 +3808,7 @@ ndmpd_tar_backup_starter_v3(void *arg)
NS_DEC(nbk);
ndmp_session_unref(session);
- return (err);
-
+ return ((void *)(uintptr_t)err);
}
@@ -3924,7 +3921,7 @@ ndmp_restore_get_params_v3(ndmpd_session_t *session,
* NDMP_NO_ERR: on success
* != NDMP_NO_ERR: otherwise
*/
-int
+void *
ndmpd_tar_restore_starter_v3(void *arg)
{
ndmpd_module_params_t *params = arg;
@@ -3948,8 +3945,7 @@ ndmpd_tar_restore_starter_v3(void *arg)
/* nlp_params is allocated in start_recover() */
NDMP_FREE(nlp->nlp_params);
ndmp_session_unref(session);
- return (err);
-
+ return ((void *)(uintptr_t)err);
}
/*
diff --git a/usr/src/cmd/ndmpd/ndmp/ndmpd_zfs.c b/usr/src/cmd/ndmpd/ndmp/ndmpd_zfs.c
index c124794fc4..72708f0475 100644
--- a/usr/src/cmd/ndmpd/ndmp/ndmpd_zfs.c
+++ b/usr/src/cmd/ndmpd/ndmp/ndmpd_zfs.c
@@ -11,10 +11,10 @@
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- * - Redistributions of source code must retain the above copyright
+ * - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
- * - Redistributions in binary form must reproduce the above copyright
+ * - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
@@ -74,12 +74,12 @@ static void ndmpd_zfs_close_one_fd(ndmpd_zfs_args_t *, int);
static int ndmpd_zfs_header_write(ndmpd_session_t *);
static int ndmpd_zfs_header_read(ndmpd_zfs_args_t *);
-static int ndmpd_zfs_backup_send_read(ndmpd_zfs_args_t *);
-static int ndmpd_zfs_backup_tape_write(ndmpd_zfs_args_t *);
+static void *ndmpd_zfs_backup_send_read(void *);
+static void *ndmpd_zfs_backup_tape_write(void *);
static int ndmpd_zfs_restore(ndmpd_zfs_args_t *);
-static int ndmpd_zfs_restore_tape_read(ndmpd_zfs_args_t *);
-static int ndmpd_zfs_restore_recv_write(ndmpd_zfs_args_t *);
+static void *ndmpd_zfs_restore_tape_read(void *);
+static void *ndmpd_zfs_restore_recv_write(void *);
static int ndmpd_zfs_reader_writer(ndmpd_zfs_args_t *, int **, int **);
@@ -143,8 +143,8 @@ static int ndmpd_zfs_backup(ndmpd_zfs_args_t *);
*
* Examples:
*
- * 0.0.n/0.bob.p
- * 0.0.u/1.bob.p/0.jane.d
+ * 0.0.n/0.bob.p
+ * 0.0.u/1.bob.p/0.jane.d
*
* Note: NDMPD_ZFS_SUBPROP_MAX is calculated based on ZFS_MAXPROPLEN
*/
@@ -164,8 +164,8 @@ static int ndmpd_zfs_backup(ndmpd_zfs_args_t *);
#define NDMPD_ZFS_LOG_ZERR(ndmpd_zfs_args, ...) { \
NDMP_LOG(LOG_ERR, __VA_ARGS__); \
NDMP_LOG(LOG_ERR, "%s--%s", \
- libzfs_error_action((ndmpd_zfs_args)->nz_zlibh), \
- libzfs_error_description((ndmpd_zfs_args)->nz_zlibh)); \
+ libzfs_error_action((ndmpd_zfs_args)->nz_zlibh), \
+ libzfs_error_description((ndmpd_zfs_args)->nz_zlibh)); \
ndmpd_zfs_zerr_dma_log((ndmpd_zfs_args)); \
}
@@ -459,7 +459,7 @@ _err:
return (-1);
}
-int
+void *
ndmpd_zfs_backup_starter(void *arg)
{
ndmpd_zfs_args_t *ndmpd_zfs_args = arg;
@@ -492,7 +492,7 @@ _done:
ndmp_session_unref(session);
ndmpd_zfs_fini(ndmpd_zfs_args);
- return (err);
+ return ((void *)(uintptr_t)err);
}
static int
@@ -599,17 +599,18 @@ ndmpd_zfs_backup(ndmpd_zfs_args_t *ndmpd_zfs_args)
*
* This routine executes zfs_send() to create the backup data stream.
* The value of ZFS_MODE determines the type of zfs_send():
- * dataset ('d'): Only the dataset specified (i.e., top level) is backed up
- * recursive ('r'): The dataset and its child file systems are backed up
- * package ('p'): Same as 'r', except all intermediate snapshots are also
+ * dataset ('d'): Only the dataset specified (i.e., top level) is backed up
+ * recursive ('r'): The dataset and its child file systems are backed up
+ * package ('p'): Same as 'r', except all intermediate snapshots are also
* backed up
*
* Volumes do not have descednants, so 'd' and 'r' produce equivalent results.
*/
-static int
-ndmpd_zfs_backup_send_read(ndmpd_zfs_args_t *ndmpd_zfs_args)
+static void *
+ndmpd_zfs_backup_send_read(void *ptr)
{
+ ndmpd_zfs_args_t *ndmpd_zfs_args = ptr;
ndmpd_session_t *session = (ndmpd_session_t *)
(ndmpd_zfs_params->mp_daemon_cookie);
sendflags_t flags = { 0 };
@@ -623,7 +624,7 @@ ndmpd_zfs_backup_send_read(ndmpd_zfs_args_t *ndmpd_zfs_args)
if (!zhp) {
if (!session->ns_data.dd_abort)
NDMPD_ZFS_LOG_ZERR(ndmpd_zfs_args, "zfs_open");
- return (-1);
+ return ((void *)(uintptr_t)-1);
}
switch (ndmpd_zfs_args->nz_zfs_mode) {
@@ -641,14 +642,14 @@ ndmpd_zfs_backup_send_read(ndmpd_zfs_args_t *ndmpd_zfs_args)
NDMP_LOG(LOG_ERR, "unknown zfs_mode: %c",
ndmpd_zfs_args->nz_zfs_mode);
zfs_close(zhp);
- return (-1);
+ return ((void *)(uintptr_t)-1);
}
if (ndmpd_zfs_is_incremental(ndmpd_zfs_args)) {
if (ndmpd_zfs_args->nz_fromsnap[0] == '\0') {
NDMP_LOG(LOG_ERR, "no fromsnap");
zfs_close(zhp);
- return (-1);
+ return ((void *)(uintptr_t)-1);
}
fromsnap = ndmpd_zfs_args->nz_fromsnap;
}
@@ -661,7 +662,7 @@ ndmpd_zfs_backup_send_read(ndmpd_zfs_args_t *ndmpd_zfs_args)
zfs_close(zhp);
- return (err);
+ return ((void *)(uintptr_t)err);
}
/*
@@ -672,9 +673,10 @@ ndmpd_zfs_backup_send_read(ndmpd_zfs_args_t *ndmpd_zfs_args)
* ndmpd_zfs_args->nz_bufsize).
*/
-static int
-ndmpd_zfs_backup_tape_write(ndmpd_zfs_args_t *ndmpd_zfs_args)
+static void *
+ndmpd_zfs_backup_tape_write(void *ptr)
{
+ ndmpd_zfs_args_t *ndmpd_zfs_args = ptr;
ndmpd_session_t *session = (ndmpd_session_t *)
(ndmpd_zfs_params->mp_daemon_cookie);
int bufsize = ndmpd_zfs_args->nz_bufsize;
@@ -685,7 +687,7 @@ ndmpd_zfs_backup_tape_write(ndmpd_zfs_args_t *ndmpd_zfs_args)
buf = ndmp_malloc(bufsize);
if (buf == NULL) {
NDMP_LOG(LOG_DEBUG, "buf NULL");
- return (-1);
+ return ((void *)(uintptr_t)-1);
}
bytes_totalp =
@@ -704,7 +706,8 @@ ndmpd_zfs_backup_tape_write(ndmpd_zfs_args_t *ndmpd_zfs_args)
*bytes_totalp - bufsize, *bytes_totalp);
free(buf);
- return (ndmpd_zfs_addenv_backup_size(ndmpd_zfs_args,
+ return ((void *)(uintptr_t)
+ ndmpd_zfs_addenv_backup_size(ndmpd_zfs_args,
*bytes_totalp));
}
@@ -712,7 +715,7 @@ ndmpd_zfs_backup_tape_write(ndmpd_zfs_args_t *ndmpd_zfs_args)
NDMP_LOG(LOG_DEBUG, "pipe read error (errno %d)",
errno);
free(buf);
- return (-1);
+ return ((void *)(uintptr_t)-1);
}
NS_ADD(rdisk, count);
@@ -720,7 +723,7 @@ ndmpd_zfs_backup_tape_write(ndmpd_zfs_args_t *ndmpd_zfs_args)
(void) ndmpd_zfs_abort((void *) ndmpd_zfs_args);
NDMP_LOG(LOG_ERR, "MOD_WRITE error");
free(buf);
- return (-1);
+ return ((void *)(uintptr_t)-1);
}
*bytes_totalp += count;
@@ -750,7 +753,7 @@ ndmpd_zfs_addenv_backup_size(ndmpd_zfs_args_t *ndmpd_zfs_args,
return (0);
}
-int
+void *
ndmpd_zfs_restore_starter(void *arg)
{
ndmpd_zfs_args_t *ndmpd_zfs_args = arg;
@@ -770,7 +773,7 @@ ndmpd_zfs_restore_starter(void *arg)
ndmpd_zfs_fini(ndmpd_zfs_args);
- return (err);
+ return ((void *)(uintptr_t)err);
}
static int
@@ -827,9 +830,10 @@ ndmpd_zfs_restore(ndmpd_zfs_args_t *ndmpd_zfs_args)
return (err);
}
-static int
-ndmpd_zfs_restore_tape_read(ndmpd_zfs_args_t *ndmpd_zfs_args)
+static void *
+ndmpd_zfs_restore_tape_read(void *ptr)
{
+ ndmpd_zfs_args_t *ndmpd_zfs_args = ptr;
ndmpd_session_t *session = (ndmpd_session_t *)
(ndmpd_zfs_params->mp_daemon_cookie);
int bufsize = ndmpd_zfs_args->nz_bufsize;
@@ -843,7 +847,7 @@ ndmpd_zfs_restore_tape_read(ndmpd_zfs_args_t *ndmpd_zfs_args)
buf = ndmp_malloc(bufsize);
if (buf == NULL) {
NDMP_LOG(LOG_DEBUG, "buf NULL");
- return (-1);
+ return ((void *)(uintptr_t)-1);
}
bytes_totalp = &ndmpd_zfs_args->nz_nlp->nlp_bytes_total;
@@ -861,7 +865,7 @@ ndmpd_zfs_restore_tape_read(ndmpd_zfs_args_t *ndmpd_zfs_args)
NDMP_LOG(LOG_ERR, "MOD_READ error: %d; returning -1",
err);
free(buf);
- return (-1);
+ return ((void *)(uintptr_t)-1);
}
count = write(ndmpd_zfs_args->nz_pipe_fd[PIPE_TAPE], buf,
@@ -880,7 +884,7 @@ ndmpd_zfs_restore_tape_read(ndmpd_zfs_args_t *ndmpd_zfs_args)
}
free(buf);
- return (-1);
+ return ((void *)(uintptr_t)-1);
}
NS_ADD(wdisk, count);
@@ -889,7 +893,7 @@ ndmpd_zfs_restore_tape_read(ndmpd_zfs_args_t *ndmpd_zfs_args)
}
free(buf);
- return (0);
+ return (NULL);
}
/*
@@ -898,9 +902,10 @@ ndmpd_zfs_restore_tape_read(ndmpd_zfs_args_t *ndmpd_zfs_args)
* This routine executes zfs_receive() to restore the backup.
*/
-static int
-ndmpd_zfs_restore_recv_write(ndmpd_zfs_args_t *ndmpd_zfs_args)
+static void *
+ndmpd_zfs_restore_recv_write(void *ptr)
{
+ ndmpd_zfs_args_t *ndmpd_zfs_args = ptr;
ndmpd_session_t *session = (ndmpd_session_t *)
(ndmpd_zfs_params->mp_daemon_cookie);
recvflags_t flags;
@@ -921,7 +926,7 @@ ndmpd_zfs_restore_recv_write(ndmpd_zfs_args_t *ndmpd_zfs_args)
if (err && !session->ns_data.dd_abort)
NDMPD_ZFS_LOG_ZERR(ndmpd_zfs_args, "zfs_receive: %d", err);
- return (err);
+ return ((void *)(uintptr_t)err);
}
/*
@@ -941,12 +946,12 @@ ndmpd_zfs_reader_writer(ndmpd_zfs_args_t *ndmpd_zfs_args,
switch (ndmpd_zfs_params->mp_operation) {
case NDMP_DATA_OP_BACKUP:
- sendrecv_func = (funct_t)ndmpd_zfs_backup_send_read;
- tape_func = (funct_t)ndmpd_zfs_backup_tape_write;
+ sendrecv_func = ndmpd_zfs_backup_send_read;
+ tape_func = ndmpd_zfs_backup_tape_write;
break;
case NDMP_DATA_OP_RECOVER:
- sendrecv_func = (funct_t)ndmpd_zfs_restore_recv_write;
- tape_func = (funct_t)ndmpd_zfs_restore_tape_read;
+ sendrecv_func = ndmpd_zfs_restore_recv_write;
+ tape_func = ndmpd_zfs_restore_tape_read;
break;
}
diff --git a/usr/src/cmd/ndmpd/tlm/tlm_proto.h b/usr/src/cmd/ndmpd/tlm/tlm_proto.h
index f37f206e6e..6bdd214a5d 100644
--- a/usr/src/cmd/ndmpd/tlm/tlm_proto.h
+++ b/usr/src/cmd/ndmpd/tlm/tlm_proto.h
@@ -10,10 +10,10 @@
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- * - Redistributions of source code must retain the above copyright
+ * - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
- * - Redistributions in binary form must reproduce the above copyright
+ * - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
@@ -134,7 +134,7 @@ extern int tar_putdir(char *,
tlm_cmd_t *,
tlm_job_stats_t *);
-extern int tar_getfile(tlm_backup_restore_arg_t *);
+extern void * tar_getfile(void *);
extern int
tar_getdir(tlm_commands_t *,
diff --git a/usr/src/cmd/ndmpd/tlm/tlm_restore_writer.c b/usr/src/cmd/ndmpd/tlm/tlm_restore_writer.c
index 82af6967ef..f757e59deb 100644
--- a/usr/src/cmd/ndmpd/tlm/tlm_restore_writer.c
+++ b/usr/src/cmd/ndmpd/tlm/tlm_restore_writer.c
@@ -11,10 +11,10 @@
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- * - Redistributions of source code must retain the above copyright
+ * - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
- * - Redistributions in binary form must reproduce the above copyright
+ * - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
@@ -286,8 +286,8 @@ tar_getdir(tlm_commands_t *commands,
long nm_end, lnk_end;
char *name, *nmp;
cstack_t *stp;
- char *bkpath;
- char *parentlnk;
+ char *bkpath;
+ char *parentlnk;
int dir_dar = 0;
/*
@@ -987,9 +987,10 @@ tar_getdir(tlm_commands_t *commands,
/*
* Main file restore function for tar (should run as a thread)
*/
-int
-tar_getfile(tlm_backup_restore_arg_t *argp)
+void *
+tar_getfile(void *ptr)
{
+ tlm_backup_restore_arg_t *argp = ptr;
tlm_job_stats_t *job_stats;
char **sels; /* list of files desired */
char **exls; /* list of files not wanted */
@@ -1012,7 +1013,7 @@ tar_getfile(tlm_backup_restore_arg_t *argp)
if (dir == NULL) {
local_commands->tc_reader = TLM_STOP;
(void) pthread_barrier_wait(&argp->ba_barrier);
- return (-1);
+ return ((void *)(uintptr_t)-1);
}
(void) strlcpy(job, argp->ba_job, TLM_MAX_BACKUP_JOB_NAME+1);
@@ -1031,7 +1032,7 @@ tar_getfile(tlm_backup_restore_arg_t *argp)
local_commands->tc_reader = TLM_STOP;
free(dir);
(void) pthread_barrier_wait(&argp->ba_barrier);
- return (-1);
+ return ((void *)(uintptr_t)-1);
}
sels = argp->ba_sels;
@@ -1039,7 +1040,7 @@ tar_getfile(tlm_backup_restore_arg_t *argp)
local_commands->tc_reader = TLM_STOP;
free(dir);
(void) pthread_barrier_wait(&argp->ba_barrier);
- return (-1);
+ return ((void *)(uintptr_t)-1);
}
exls = &list;
@@ -1081,7 +1082,7 @@ tar_getfile(tlm_backup_restore_arg_t *argp)
local_commands->tc_reader = TLM_STOP;
tlm_release_reader_writer_ipc(local_commands);
free(dir);
- return (erc);
+ return ((void *)(uintptr_t)erc);
}
/*
diff --git a/usr/src/cmd/varpd/varpd.c b/usr/src/cmd/varpd/varpd.c
index 896f39733a..5defdd3f45 100644
--- a/usr/src/cmd/varpd/varpd.c
+++ b/usr/src/cmd/varpd/varpd.c
@@ -316,7 +316,7 @@ varpd_setup_lookup_threads(void)
thread_t thr;
ret = thr_create(NULL, 0,
- (void *(*)(void *))libvarpd_overlay_lookup_run,
+ (void *)libvarpd_overlay_lookup_run,
varpd_handle, THR_DETACHED | THR_DAEMON, &thr);
if (ret != 0)
return (ret);
diff --git a/usr/src/cmd/zoneadmd/zfd.c b/usr/src/cmd/zoneadmd/zfd.c
index 307d916154..2d2a4ce217 100644
--- a/usr/src/cmd/zoneadmd/zfd.c
+++ b/usr/src/cmd/zoneadmd/zfd.c
@@ -1211,7 +1211,7 @@ create_log_thread(zlog_t *zlogp)
return;
}
- res = thr_create(NULL, 0, (void * (*)(void *))srvr, (void *)&mode, 0,
+ res = thr_create(NULL, 0, (void *)srvr, (void *)&mode, 0,
&logger_tid);
if (res != 0) {
zerror(zlogp, B_FALSE, "error %d creating logger thread", res);
diff --git a/usr/src/cmd/zoneadmd/zoneadmd.c b/usr/src/cmd/zoneadmd/zoneadmd.c
index 7c8d2a2bbc..3715ab2a7e 100644
--- a/usr/src/cmd/zoneadmd/zoneadmd.c
+++ b/usr/src/cmd/zoneadmd/zoneadmd.c
@@ -297,8 +297,9 @@ zerror(zlog_t *zlogp, boolean_t use_strerror, const char *fmt, ...)
static void
strnappend(char *dest, size_t n, const char *src)
{
- (void) snprintf(dest, n, "%s%s%s", dest,
- dest[0] == '\0' ? "" : " ", src);
+ char *sep = (dest[0] == '\0') ? "" : " ";
+ (void) strlcat(dest, sep, n);
+ (void) strlcat(dest, src, n);
}
/*