libudev-device-private.c revision c8f8394a9309d4390daac70b736b34d0b6734f95
/*
* libudev - interface to udev device information
*
* Copyright (C) 2008-2010 Kay Sievers <kay.sievers@vrfy.org>
*
* 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.
*/
#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;
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);
return 0;
}
{
const char *id;
char filename[UTIL_PATH_SIZE];
return -1;
return 0;
}