udev_db.c revision 17fcfb5972977b6a3aedca6ad2aa8d1fbfbc761d
/*
* Copyright (C) 2003 Greg Kroah-Hartman <greg@kroah.com>
* Copyright (C) 2004-2008 Kay Sievers <kay.sievers@vrfy.org>
*
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stddef.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include <errno.h>
#include <dirent.h>
#include "udev.h"
static size_t devpath_to_db_path(struct udev *udev, const char *devpath, char *filename, size_t len)
{
/* translate to location of db file */
}
/* reverse mapping from the device file name to the devpath */
{
char device[UTIL_PATH_SIZE];
int fd;
/* directory with device name */
/* entry with the devpath */
if (add) {
if (fd > 0)
} else {
}
return 0;
}
{
int rc = 0;
rc = -1;
goto out;
}
while (1) {
char device[UTIL_PATH_SIZE];
break;
continue;
rc++;
}
out:
return rc;
}
{
char filename[UTIL_PATH_SIZE];
char filename_old[UTIL_PATH_SIZE];
}
{
char filename[UTIL_PATH_SIZE];
return 0;
/*
* don't waste tmpfs memory pages, if we don't have any data to store
* create fake db-file; store the node-name in a symlink target
*/
int ret;
if (ret != 0) {
return -1;
}
} else {
FILE *f;
struct name_entry *name_loop;
if (f == NULL) {
return -1;
}
/* add symlink-name to index */
}
if (udevice->link_priority != 0)
if (udevice->event_timeout >= 0)
if (udevice->partitions != 0)
if (udevice->ignore_remove)
fclose(f);
}
/* add name to index */
return 0;
}
{
char filename[UTIL_PATH_SIZE];
char line[UTIL_PATH_SIZE];
char *bufline;
char *buf;
return -1;
}
char target[UTIL_NAME_SIZE];
int target_len;
if (target_len > 0)
else {
return -1;
}
return 0;
}
return -1;
}
cur = 0;
switch(bufline[0]) {
case 'N':
break;
case 'M':
break;
case 'S':
break;
case 'L':
break;
case 'T':
break;
case 'A':
break;
case 'R':
break;
case 'E':
break;
}
}
return -1;
return 0;
}
{
char filename[UTIL_PATH_SIZE];
struct name_entry *name_loop;
return 0;
return 0;
}
{
return -1;
}
while (1) {
char device[UTIL_PATH_SIZE];
break;
continue;
}
return 0;
}