udevadm-test.c revision 065db052211d3bf08d9b0f698a79a8798faf11d2
/*
* 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 "udev.h"
{
char filename[UTIL_PATH_SIZE];
const char *action = "add";
struct udev_event *event;
struct udev_device *dev;
int err;
int rc = 0;
{}
};
while (1) {
int option;
if (option == -1)
break;
switch (option) {
case 'a':
break;
case 'h':
printf("Usage: udevadm test OPTIONS <syspath>\n"
" --action=<string> set action string\n"
" --help\n\n");
exit(0);
default:
exit(1);
}
}
rc = 1;
goto exit;
}
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 = 1;
goto exit;
}
/* add /sys if needed */
else
rc = 2;
goto exit;
}
/* skip reading of db, but read kernel parameters */
if (udev_device_get_event_timeout(dev) >= 0)
struct udev_list_entry *entry;
char program[UTIL_PATH_SIZE];
}
}
exit:
return rc;
}