udev_utils.c revision 01618658fd82dbc5e6315b639f00e87c6fee3c54
/*
* 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.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#include <stdlib.h>
#include <stdio.h>
#include <stddef.h>
#include <unistd.h>
#include <string.h>
#include <fcntl.h>
#include <errno.h>
#include <ctype.h>
#include <dirent.h>
#include <syslog.h>
#include <pwd.h>
#include <grp.h>
#include "udev.h"
int log_priority(const char *priority)
{
char *endptr;
int prio;
if (endptr[0] == '\0')
return prio;
return LOG_ERR;
return LOG_INFO;
return LOG_DEBUG;
if (string_is_true(priority))
return LOG_ERR;
return 0;
}
{
struct name_entry *name_loop;
struct name_entry *name_new;
/* avoid duplicate entries */
return name_loop;
}
}
if (sort)
break;
}
return NULL;
return name_new;
}
struct name_entry *name_list_key_add(struct list_head *name_list, const char *key, const char *value)
{
struct name_entry *name_loop;
struct name_entry *name_new;
return name_loop;
}
}
return NULL;
return name_new;
}
{
struct name_entry *name_loop;
struct name_entry *name_tmp;
int retval = 0;
continue;
continue;
retval = 1;
break;
}
return retval;
}
{
struct name_entry *name_loop;
struct name_entry *name_tmp;
}
}
/* calls function for every file found in specified directory */
{
return -1;
}
while (1) {
break;
continue;
/* look for file matching with specified suffix */
const char *ext;
continue;
continue;
}
}
return 0;
}
{
errno = 0;
else
} else
return uid;
}
{
errno = 0;
else
} else
return gid;
}