diff options
author | kay.sievers@vrfy.org <kay.sievers@vrfy.org> | 2004-09-15 22:36:31 -0700 |
---|---|---|
committer | Greg KH <gregkh@suse.de> | 2005-04-26 21:37:01 -0700 |
commit | cdc60e8afb06a0688e4b9f166625d4d0b8805e68 (patch) | |
tree | 16fbc84eae9b43fe64e95ce25ca7cff423d09ba4 /udevsend.c | |
parent | 0345b8623581497f49184ffd1d8143fe20f71893 (diff) |
[PATCH] switch udev's seqnum to u64
The kernel will use a u64 for the sequence number, so we want the same.
Diffstat (limited to 'udevsend.c')
-rw-r--r-- | udevsend.c | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/udevsend.c b/udevsend.c index a52d6ec165..842a2a4bc4 100644 --- a/udevsend.c +++ b/udevsend.c @@ -53,17 +53,6 @@ void log_message (int level, const char *format, ...) } #endif -static void build_hotplugmsg(struct hotplug_msg *msg, char *action, - char *devpath, char *subsystem, int seqnum) -{ - memset(msg, 0x00, sizeof(struct hotplug_msg)); - strfieldcpy(msg->magic, UDEV_MAGIC); - msg->seqnum = seqnum; - strfieldcpy(msg->action, action); - strfieldcpy(msg->devpath, devpath); - strfieldcpy(msg->subsystem, subsystem); -} - static int start_daemon(void) { pid_t pid; @@ -125,7 +114,7 @@ int main(int argc, char* argv[]) char *devpath; char *subsystem; char *seqnum; - int seq; + unsigned long long seq; int retval = 1; int loop; struct timespec tspec; @@ -160,10 +149,10 @@ int main(int argc, char* argv[]) seqnum = get_seqnum(); if (seqnum == NULL) - seq = -1; + seq = 0; else - seq = atoi(seqnum); - dbg("SEQNUM = '%d'", seq); + seq = strtoull(seqnum, NULL, 10); + dbg("SEQNUM = '%llu'", seq); sock = socket(AF_LOCAL, SOCK_DGRAM, 0); if (sock == -1) { @@ -177,7 +166,12 @@ int main(int argc, char* argv[]) strcpy(&saddr.sun_path[1], UDEVD_SOCK_PATH); addrlen = offsetof(struct sockaddr_un, sun_path) + strlen(saddr.sun_path+1) + 1; - build_hotplugmsg(&msg, action, devpath, subsystem, seq); + memset(&msg, 0x00, sizeof(struct hotplug_msg)); + strcpy(msg.magic, UDEV_MAGIC); + msg.seqnum = seq; + strfieldcpy(msg.action, action); + strfieldcpy(msg.devpath, devpath); + strfieldcpy(msg.subsystem, subsystem); /* If we can't send, try to start daemon and resend message */ loop = UDEVSEND_CONNECT_RETRY; |