/***
This file is part of systemd.
Copyright 2010 Lennart Poettering
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
systemd is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
#include <errno.h>
#include <stddef.h>
#include <string.h>
#include "fd-util.h"
#include "log.h"
#include "macro.h"
#include "string-util.h"
#include "util.h"
union {
} sa = {
};
if (sendto(fd, packet, size, MSG_NOSIGNAL, &sa.sa, offsetof(struct sockaddr_un, sun_path) + strlen(socket_name)) < 0)
return 0;
}
int r;
log_open();
if (argc != 3) {
log_error("Wrong number of arguments.");
return EXIT_FAILURE;
}
packet[0] = '+';
goto finish;
}
packet[0] = '-';
length = 1;
} else {
r = -EINVAL;
goto finish;
}
if (fd < 0) {
goto finish;
}
return r < 0 ? EXIT_FAILURE : EXIT_SUCCESS;
}