udev_db.c revision 95776dc6ec174f47fa4dd4d8abf5d457223e5dd4
/*
*
* Copyright (C) 2003 Greg Kroah-Hartman <greg@kroah.com>
* Copyright (C) 2004-2005 Kay Sievers <kay.sievers@vrfy.org>
*
* under the terms of the GNU General Public License as published by the
* Free Software Foundation version 2 of the License.
*
* 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, write to the Free Software Foundation, Inc.,
* 675 Mass Ave, Cambridge, MA 02139, USA.
*
*/
#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"
{
/* add location of db files */
/* replace '/' to transform path into a filename */
if (filename[i] == '/')
filename[i] = PATH_TO_NAME_CHAR;
return 0;
}
{
/* replace PATH_TO_NAME_CHAR to transform name into devpath */
for (i = 1; i < end; i++)
if (devpath[i] == PATH_TO_NAME_CHAR)
devpath[i] = '/';
return 0;
}
{
return 0;
/*
* create only a symlink with the name as the target
* if we don't have any interesting data to remember
*/
dbg("nothing interesting to store, create symlink");
return -1;
}
} else {
struct name_entry *name_loop;
FILE *f;
if (f == NULL) {
return -1;
}
if (udev->partitions)
if (udev->ignore_remove)
fclose(f);
}
return 0;
}
{
char *bufline;
char *buf;
return -1;
}
int target_len;
info("found a symlink as db file");
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 'A':
break;
case 'R':
break;
case 'E':
break;
}
}
return -1;
return 0;
}
{
return 0;
}
{
int found = 0;
return -1;
}
while (!found) {
char *bufline;
char *buf;
break;
continue;
continue;
}
int target_len;
info("found a symlink as db file");
if (target_len > 0)
else {
return -1;
}
found =1;
}
continue;
}
continue;
}
cur = 0;
switch(bufline[0]) {
case 'N':
case 'S':
found = 1;
}
break;
default:
continue;
}
}
}
if (found)
return 0;
else
return -1;
}
{
return -1;
}
while (1) {
break;
continue;
for (i = 1; i < end; i++)
if (filename[i] == PATH_TO_NAME_CHAR)
filename[i] = '/';
}
return 0;
}