-/*
- * libudev - interface to udev device information
- *
- * Copyright (C) 2008 Kay Sievers <kay.sievers@vrfy.org>
- * Copyright (C) 2009 Alan Jenkins <alan-jenkins@tuffmail.co.uk>
- *
- * This library is free software; you can redistribute it and/or
- * modify it 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.
- */
+/***
+ This file is part of systemd.
+
+ Copyright 2008-2012 Kay Sievers <kay@vrfy.org>
+ Copyright 2009 Alan Jenkins <alan-jenkins@tuffmail.co.uk>
+
+ systemd is free software; you can redistribute it and/or modify it
+ 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/>.
+***/
/*
* DISCLAIMER - The file format mentioned here is private to udev/libudev,
/* allocate the table */
range = udev_queue_export->seqnum_min - udev_queue_export->seqnum_max;
if (range - 1 > INT_MAX) {
- err(udev_queue_export->udev, "queue file overflow\n");
+ udev_err(udev_queue_export->udev, "queue file overflow\n");
return NULL;
}
devpaths = calloc(1, sizeof(struct queue_devpaths) + (range + 1) * sizeof(long));
return devpaths;
read_error:
- err(udev_queue_export->udev, "queue file corrupted\n");
+ udev_err(udev_queue_export->udev, "queue file corrupted\n");
free(devpaths);
return NULL;
}
}
/* create new queue file */
- new_queue_file = fopen("/run/udev/queue.tmp", "w+");
+ new_queue_file = fopen("/run/udev/queue.tmp", "w+e");
if (new_queue_file == NULL)
goto error;
seqnum = udev_queue_export->seqnum_max;
return 0;
error:
- err(udev_queue_export->udev, "failed to create queue file: %m\n");
+ udev_err(udev_queue_export->udev, "failed to create queue file: %m\n");
udev_queue_export_cleanup(udev_queue_export);
if (udev_queue_export->queue_file != NULL) {
write_error:
/* if we failed half way through writing a record to a file,
we should not try to write any further records to it. */
- err(udev_queue_export->udev, "error writing to queue file: %m\n");
+ udev_err(udev_queue_export->udev, "error writing to queue file: %m\n");
fclose(udev_queue_export->queue_file);
udev_queue_export->queue_file = NULL;