libudev-device-private.c revision 88a6477ef32ac4c59111f7340525714a6e02e503
/***
This file is part of systemd.
Copyright 2008-2012 Kay Sievers <kay@vrfy.org>
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 <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stddef.h>
#include <stdbool.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include "libudev.h"
#include "libudev-private.h"
{
const char *id;
char filename[UTIL_PATH_SIZE];
return;
if (add) {
int fd;
if (fd >= 0)
} else {
}
}
{
struct udev_list_entry *list_entry;
bool found;
/* delete possible left-over tags */
struct udev_list_entry *list_entry_current;
found = false;
found = true;
break;
}
}
if (!found)
}
}
return 0;
}
{
struct udev_list_entry *list_entry;
return true;
if (udev_device_get_devlink_priority(udev_device) != 0)
return true;
return true;
return true;
if (udev_device_get_watch_handle(udev_device) >= 0)
return true;
return false;
}
{
bool has_info;
const char *id;
char filename[UTIL_PATH_SIZE];
char filename_tmp[UTIL_PATH_SIZE];
FILE *f;
int r;
return -1;
/* do not store anything for otherwise empty devices */
if (!has_info &&
udev_device_get_ifindex(udev_device) == 0) {
return 0;
}
/* write a database file */
if (f == NULL) {
return -1;
}
/*
* set 'sticky' bit to indicate that we should not clean the
* database when we transition from initramfs to the real root
*/
if (has_info) {
struct udev_list_entry *list_entry;
if (udev_device_get_devlink_priority(udev_device) != 0)
if (udev_device_get_watch_handle(udev_device) >= 0)
}
if (udev_device_get_usec_initialized(udev_device) > 0)
continue;
fprintf(f, "E:%s=%s\n",
}
}
fclose(f);
if (r < 0)
return -1;
return 0;
}
{
const char *id;
char filename[UTIL_PATH_SIZE];
return -1;
return 0;
}