* Error binding udev_event socket: Address already in use
@ 2010-02-25 8:11 belle
2010-02-25 9:11 ` belle
2010-02-26 1:09 ` belle
0 siblings, 2 replies; 3+ messages in thread
From: belle @ 2010-02-25 8:11 UTC (permalink / raw)
To: linux-hotplug
dear all:
i wrote a program and i used the udev_event socket to receive the
udev event, and when i first to run my program, everything goes ok,but
after i killed my program and run it again,i find a promote of "Error
binding udev_event socket: Address already in use",and i can't receive
the udev event. and i restart the udevd daemon,but still i can't receive
the udev event, is there anyone who can give me some advice? i have
been working on it for a long time, it really a nightmare to me, thanks
for advance
^ permalink raw reply [flat|nested] 3+ messages in thread
* Error binding udev_event socket: Address already in use
2010-02-25 8:11 Error binding udev_event socket: Address already in use belle
@ 2010-02-25 9:11 ` belle
2010-02-26 1:09 ` belle
1 sibling, 0 replies; 3+ messages in thread
From: belle @ 2010-02-25 9:11 UTC (permalink / raw)
To: linux-hotplug
dear all:
i wrote a program and i used the udev_event socket to receive the
udev event, the program is as follow:
int udev_socket;
struct sockaddr_un saddr;
socklen_t addrlen;
const int on = 1;
GIOChannel *udev_channel;
printf("net_manage_init\n");
memset(&saddr, 0x00, sizeof(saddr));
saddr.sun_family = AF_LOCAL;
strcpy(&saddr.sun_path[1], "/com/yy/net_manager");
addrlen = offsetof(struct sockaddr_un, sun_path)
+strlen(saddr.sun_path+1) + 1;
udev_socket = socket(AF_LOCAL, SOCK_DGRAM, 0);
if (udev_socket = -1) {
printf("Couldn't open socket");
return;
}
if (bind(udev_socket, (struct sockaddr *) &saddr, addrlen) < 0) {
printf ("Error binding udev_event socket: %s\n",
strerror(errno));
return;
}
setsockopt(udev_socket, SOL_SOCKET, SO_PASSCRED, &on, sizeof(on));
and when i first to run my program, everything goes ok,but
after i killed my program and run it again,i find a promote of "Error
binding udev_event socket: Address already in use",and i can't receive
the udev event. and i restart the udevd daemon,but still i can't receive
the udev event, is there anyone who can give me some advice? i have
been working on it for a long time, it really a nightmare to me, thanks
for advance
^ permalink raw reply [flat|nested] 3+ messages in thread
* Error binding udev_event socket: Address already in use
2010-02-25 8:11 Error binding udev_event socket: Address already in use belle
2010-02-25 9:11 ` belle
@ 2010-02-26 1:09 ` belle
1 sibling, 0 replies; 3+ messages in thread
From: belle @ 2010-02-26 1:09 UTC (permalink / raw)
To: linux-hotplug
dear all:
i wrote a program and i used the udev_event socket to receive the
udev event, the program is as follow:
int udev_socket;
struct sockaddr_un saddr;
socklen_t addrlen;
const int on = 1;
GIOChannel *udev_channel;
printf("net_manage_init\n");
memset(&saddr, 0x00, sizeof(saddr));
saddr.sun_family = AF_LOCAL;
strcpy(&saddr.sun_path[1], "/com/yy/net_manager");
addrlen = offsetof(struct sockaddr_un, sun_path)
+strlen(saddr.sun_path+1) + 1;
udev_socket = socket(AF_LOCAL, SOCK_DGRAM, 0);
if (udev_socket = -1) {
printf("Couldn't open socket");
return;
}
if (bind(udev_socket, (struct sockaddr *) &saddr, addrlen) < 0) {
printf ("Error binding udev_event socket: %s\n",
strerror(errno));
return;
}
setsockopt(udev_socket, SOL_SOCKET, SO_PASSCRED, &on, sizeof(on));
and when i first to run my program, everything goes ok,but
after i killed my program and run it again,i find a promote of "Error
binding udev_event socket: Address already in use",and i can't receive
the udev event. and i restart the udevd daemon,but still i can't receive
the udev event, is there anyone who can give me some advice? i have
been working on it for a long time, it really a nightmare to me, thanks
for advance
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-02-26 1:09 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-25 8:11 Error binding udev_event socket: Address already in use belle
2010-02-25 9:11 ` belle
2010-02-26 1:09 ` belle
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).