Skip to content

Commit

Permalink
fix gcc warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
gajdusek committed Apr 1, 2013
1 parent f54b212 commit 972ea41
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
2 changes: 0 additions & 2 deletions src/linux_netlink.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ nl_connection_handler (GSocket *socket, GIOCondition condition, gpointer user_da
char buff[BUFF_SIZE]; char buff[BUFF_SIZE];
size_t recv_len; size_t recv_len;
struct sockaddr_nl from_nla; struct sockaddr_nl from_nla;
socklen_t from_nla_len;
struct nlmsghdr *nlh; struct nlmsghdr *nlh;
struct sockaddr_nl kern_nla; struct sockaddr_nl kern_nla;
struct cn_msg *cn_hdr; struct cn_msg *cn_hdr;
Expand All @@ -172,7 +171,6 @@ nl_connection_handler (GSocket *socket, GIOCondition condition, gpointer user_da
kern_nla.nl_pad = 0; kern_nla.nl_pad = 0;


memset(buff, 0, sizeof(buff)); memset(buff, 0, sizeof(buff));
from_nla_len = sizeof(from_nla);
memcpy(&from_nla, &kern_nla, sizeof(from_nla)); memcpy(&from_nla, &kern_nla, sizeof(from_nla));


/* the helper process exited */ /* the helper process exited */
Expand Down
2 changes: 2 additions & 0 deletions src/sysctl.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ enum {


#define IOPRIO_CLASS_SHIFT 13 #define IOPRIO_CLASS_SHIFT 13


/* // test
static void ioprio_print(int pid) static void ioprio_print(int pid)
{ {
int ioprio, ioclass; int ioprio, ioclass;
Expand All @@ -83,6 +84,7 @@ static void ioprio_print(int pid)
printf("%s\n", to_prio[ioclass]); printf("%s\n", to_prio[ioclass]);
} }
} }
*/


int ioprio_getpid(pid_t pid, int *ioprio, int *ioclass) { int ioprio_getpid(pid_t pid, int *ioprio, int *ioclass) {
int rv = ioprio_get(IOPRIO_WHO_PROCESS, pid); int rv = ioprio_get(IOPRIO_WHO_PROCESS, pid);
Expand Down
8 changes: 5 additions & 3 deletions src/ulatencyd.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -373,7 +373,6 @@ gboolean g_spawn_sync ("/",
#ifdef ENABLE_DBUS #ifdef ENABLE_DBUS
static int do_dbus_init() { static int do_dbus_init() {
GError *error = NULL; GError *error = NULL;
DBusConnection *con;
#ifdef DEVELOP_DBUS_SESSION #ifdef DEVELOP_DBUS_SESSION
char *env_uid; char *env_uid;
uid_t target = 0; uid_t target = 0;
Expand Down Expand Up @@ -406,9 +405,12 @@ static int do_dbus_init() {
g_error_free (error); g_error_free (error);
return FALSE; return FALSE;
} }
con = dbus_g_connection_get_connection(U_dbus_connection);
#ifndef DEVELOP_MODE #ifndef DEVELOP_MODE
DBusConnection *con;
con = dbus_g_connection_get_connection(U_dbus_connection);
dbus_connection_set_exit_on_disconnect (con, FALSE); dbus_connection_set_exit_on_disconnect (con, FALSE);
#else
dbus_g_connection_get_connection(U_dbus_connection);
#endif #endif
return TRUE; return TRUE;
} }
Expand Down Expand Up @@ -587,7 +589,7 @@ int main (int argc, char *argv[])
open_logfile(log_file); open_logfile(log_file);
} }


g_log(G_LOG_DOMAIN, G_LOG_LEVEL_MESSAGE, ""); g_log(G_LOG_DOMAIN, G_LOG_LEVEL_MESSAGE, " ");
g_log(G_LOG_DOMAIN, G_LOG_LEVEL_MESSAGE, "================= starting ulatencyd ================="); g_log(G_LOG_DOMAIN, G_LOG_LEVEL_MESSAGE, "================= starting ulatencyd =================");


main_context = g_main_context_default(); main_context = g_main_context_default();
Expand Down
4 changes: 2 additions & 2 deletions tests/forkbomb.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ main (argc, argv)
int work = 0; int work = 0;
int rand = open("/dev/urandom",O_RDONLY); int rand = open("/dev/urandom",O_RDONLY);
int data[2]; int data[2];
int tmpi; int tmpi = 0;
pid_t pid; pid_t pid;




Expand Down Expand Up @@ -131,7 +131,7 @@ main (argc, argv)
if(work) { if(work) {
read(rand, &data, sizeof(int)*2); read(rand, &data, sizeof(int)*2);
if(data[1] != 0) { if(data[1] != 0) {
tmpi = data[0]/data[1]; tmpi += data[0]/data[1];
} }
} else { } else {
sleep(10000); sleep(10000);
Expand Down

0 comments on commit 972ea41

Please sign in to comment.