summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2011-10-10 02:30:42 +0200
committerKay Sievers <kay.sievers@vrfy.org>2011-10-10 02:30:42 +0200
commit29282732bd7d78d90713ee56f8bac71777362ef2 (patch)
tree0baa7de178381960919416ec06426b959b285c98
parent1f5a5100f3bdfdaf9ef71b29931574b678ff0d82 (diff)
udev_ctrl_cleanup()- accept NULL as argument
-rw-r--r--udev/udev-ctrl.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/udev/udev-ctrl.c b/udev/udev-ctrl.c
index 4bca807b69..e4348c314d 100644
--- a/udev/udev-ctrl.c
+++ b/udev/udev-ctrl.c
@@ -162,6 +162,8 @@ struct udev_ctrl *udev_ctrl_unref(struct udev_ctrl *uctrl)
int udev_ctrl_cleanup(struct udev_ctrl *uctrl)
{
+ if (uctrl == NULL)
+ return 0;
if (uctrl->cleanup_socket)
unlink(uctrl->saddr.sun_path);
return 0;
@@ -170,7 +172,7 @@ int udev_ctrl_cleanup(struct udev_ctrl *uctrl)
int udev_ctrl_get_fd(struct udev_ctrl *uctrl)
{
if (uctrl == NULL)
- return -1;
+ return -EINVAL;
return uctrl->sock;
}