From: Kay Sievers Date: Mon, 10 Oct 2011 00:30:42 +0000 (+0200) Subject: udev_ctrl_cleanup()- accept NULL as argument X-Git-Tag: 174~7 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=29282732bd7d78d90713ee56f8bac71777362ef2;p=systemd udev_ctrl_cleanup()- accept NULL as argument --- diff --git a/udev/udev-ctrl.c b/udev/udev-ctrl.c index 4bca807b..e4348c31 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; }