udevadm-test.c revision 6ada823a9a0979ea145fd70add1007c21caa45c0
/*
* Copyright (C) 2003-2004 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 <string.h>
#include <stdio.h>
#include <stddef.h>
#include <unistd.h>
#include <errno.h>
#include <ctype.h>
#include <fcntl.h>
#include <signal.h>
#include <syslog.h>
#include <getopt.h>
#include <sys/signalfd.h>
#include "udev.h"
{
int resolve_names = 1;
char filename[UTIL_PATH_SIZE];
const char *action = "add";
struct udev_list_entry *entry;
int err;
int rc = 0;
{}
};
for (;;) {
int option;
if (option == -1)
break;
switch (option) {
case 'a':
break;
case 'N':
resolve_names = 1;
resolve_names = 0;
resolve_names = -1;
} else {
log_error("resolve-names must be early, late or never\n");
}
break;
case 'h':
printf("Usage: udevadm test OPTIONS <syspath>\n"
" --action=<string> set action string\n"
" --help\n\n");
default:
}
}
rc = 2;
goto out;
}
printf("This program is for debugging only, it does not run any program\n"
"specified by a RUN key. It may show incorrect results, because\n"
"some values may be different, or not available at a simulation run.\n"
"\n");
rc = 3;
goto out;
}
/* add /sys if needed */
else
rc = 4;
goto out;
}
/* skip reading of db, but read kernel parameters */
sigfillset(&mask);
rc = 5;
goto out;
}
if (err == 0) {
char program[UTIL_PATH_SIZE];
}
}
out:
return rc;
}
const struct udevadm_cmd udevadm_test = {
.name = "test",
.help = "test an event run",
.debug = true,
};