summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToomas Soome <tsoome@me.com>2017-08-10 14:44:15 +0300
committerDan McDonald <danmcd@joyent.com>2017-11-16 10:43:01 -0500
commitd9e525a856d3050197717c45fb58667e0ee0f297 (patch)
treec959833db936d21607439a1937a991960b130f16
parent0803869a9bc0aff1c81287ac6eae15943cbba545 (diff)
downloadillumos-joyent-d9e525a856d3050197717c45fb58667e0ee0f297.tar.gz
8767 cmd/hal: variable set but not used
Reviewed by: Yuri Pankov <yuripv@gmx.com> Approved by: Dan McDonald <danmcd@joyent.com>
-rw-r--r--usr/src/cmd/hal/hald/device_info.c3
-rw-r--r--usr/src/cmd/hal/hald/hald.c12
-rw-r--r--usr/src/cmd/hal/hald/hald_dbus.c2
-rw-r--r--usr/src/cmd/hal/hald/solaris/devinfo_storage.c2
-rw-r--r--usr/src/cmd/hal/probing/network-printer/probe-snmp.c5
5 files changed, 7 insertions, 17 deletions
diff --git a/usr/src/cmd/hal/hald/device_info.c b/usr/src/cmd/hal/hald/device_info.c
index e4e1ae7fee..8d557a6ea6 100644
--- a/usr/src/cmd/hal/hald/device_info.c
+++ b/usr/src/cmd/hal/hald/device_info.c
@@ -1368,7 +1368,6 @@ process_fdi_file (const char *dir, const char *filename,
char buf[512];
FILE *file;
int filesize;
- size_t read;
char *filebuf;
dbus_bool_t device_matched;
XML_Parser parser;
@@ -1400,7 +1399,7 @@ process_fdi_file (const char *dir, const char *filename,
HAL_ERROR (("Could not allocate %d bytes for file %s", filesize, buf));
goto out;
}
- read = fread (filebuf, sizeof (char), filesize, file);
+ (void) fread (filebuf, sizeof (char), filesize, file);
/* initialize parsing context */
parsing_context =
diff --git a/usr/src/cmd/hal/hald/hald.c b/usr/src/cmd/hal/hald/hald.c
index c2ed17756e..c05e45cb06 100644
--- a/usr/src/cmd/hal/hald/hald.c
+++ b/usr/src/cmd/hal/hald/hald.c
@@ -241,7 +241,6 @@ static GIOChannel *sigterm_iochn;
static void
handle_sigterm (int value)
{
- ssize_t written;
static char marker[1] = {'S'};
/* write a 'S' character to the other end to tell about
@@ -250,7 +249,7 @@ handle_sigterm (int value)
* defer this since UNIX signal handlers are evil
*
* Oh, and write(2) is indeed reentrant */
- written = write (sigterm_unix_signal_pipe_fds[1], marker, 1);
+ (void) write (sigterm_unix_signal_pipe_fds[1], marker, 1);
}
static gboolean
@@ -362,7 +361,6 @@ int
main (int argc, char *argv[])
{
GMainLoop *loop;
- guint sigterm_iochn_listener_source_id;
char *path;
char newpath[512];
@@ -475,7 +473,6 @@ main (int argc, char *argv[])
int child_pid;
int dev_null_fd;
int pf;
- ssize_t written;
char pid[9];
HAL_INFO (("Will daemonize"));
@@ -529,7 +526,7 @@ main (int argc, char *argv[])
/* Make a new one */
if ((pf= open (HALD_PID_FILE, O_WRONLY|O_CREAT|O_TRUNC|O_EXCL, 0644)) > 0) {
snprintf (pid, sizeof(pid), "%lu\n", (long unsigned) getpid ());
- written = write (pf, pid, strlen(pid));
+ (void) write (pf, pid, strlen(pid));
close (pf);
atexit (delete_pid);
}
@@ -554,7 +551,7 @@ main (int argc, char *argv[])
DIE (("Could not create GIOChannel"));
/* get callback when there is data to read */
- sigterm_iochn_listener_source_id = g_io_add_watch (
+ (void) g_io_add_watch (
sigterm_iochn, G_IO_IN, sigterm_iochn_data, NULL);
/* Finally, setup unix signal handler for TERM */
@@ -613,7 +610,6 @@ next:
void
osspec_probe_done (void)
{
- ssize_t written;
char buf[1] = {0};
HAL_INFO (("Device probing completed"));
@@ -624,7 +620,7 @@ osspec_probe_done (void)
}
/* tell parent to exit */
- written = write (startup_daemonize_pipe[1], buf, sizeof (buf));
+ (void) write (startup_daemonize_pipe[1], buf, sizeof (buf));
close (startup_daemonize_pipe[0]);
close (startup_daemonize_pipe[1]);
diff --git a/usr/src/cmd/hal/hald/hald_dbus.c b/usr/src/cmd/hal/hald/hald_dbus.c
index e3b2046201..1d7655e158 100644
--- a/usr/src/cmd/hal/hald/hald_dbus.c
+++ b/usr/src/cmd/hal/hald/hald_dbus.c
@@ -1071,7 +1071,7 @@ device_set_multiple_properties (DBusConnection *connection, DBusMessage *message
DBusMessageIter dict_entry_iter, var_iter, array_iter;
const char *key;
int change_type;
- dbus_bool_t rc;
+ dbus_bool_t rc __unused;
dbus_message_iter_recurse (&dict_iter, &dict_entry_iter);
dbus_message_iter_get_basic (&dict_entry_iter, &key);
diff --git a/usr/src/cmd/hal/hald/solaris/devinfo_storage.c b/usr/src/cmd/hal/hald/solaris/devinfo_storage.c
index 0bf1a563dd..bfe027ad25 100644
--- a/usr/src/cmd/hal/hald/solaris/devinfo_storage.c
+++ b/usr/src/cmd/hal/hald/solaris/devinfo_storage.c
@@ -1576,14 +1576,12 @@ devinfo_volume_force_unmount_cb (HalDevice *d, guint32 exit_type,
static void
devinfo_volume_force_unmount (HalDevice *d, void *end_token)
{
- const char *device_file;
const char *mount_point;
char *unmount_stdin;
char *extra_env[2];
extra_env[0] = "HAL_METHOD_INVOKED_BY_UID=0";
extra_env[1] = NULL;
- device_file = hal_device_property_get_string (d, "block.device");
mount_point = hal_device_property_get_string (d, "volume.mount_point");
if (mount_point == NULL || strlen (mount_point) == 0 || !hal_util_is_mounted_by_hald (mount_point)) {
diff --git a/usr/src/cmd/hal/probing/network-printer/probe-snmp.c b/usr/src/cmd/hal/probing/network-printer/probe-snmp.c
index 7645ff9977..63a17de47f 100644
--- a/usr/src/cmd/hal/probing/network-printer/probe-snmp.c
+++ b/usr/src/cmd/hal/probing/network-printer/probe-snmp.c
@@ -5,8 +5,6 @@
* Licensed under the Academic Free License version 2.1
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
@@ -52,7 +50,6 @@ hrDeviceDesc_to_info(char *string, char **manufacturer, char **model,
static struct snmp_pdu *
snmp_get_item(char *host, char *community, char *mib_item)
{
- int status;
struct snmp_session session, *ss;
struct snmp_pdu *request = NULL, *result = NULL;
oid Oid[MAX_OID_LEN];
@@ -77,7 +74,7 @@ snmp_get_item(char *host, char *community, char *mib_item)
request = snmp_pdu_create(SNMP_MSG_GET);
snmp_add_null_var(request, Oid, oid_len);
- status = snmp_synch_response(ss, request, &result);
+ (void) snmp_synch_response(ss, request, &result);
snmp_close(ss);