udevadm-test-builtin.c revision 33502ffe2eb7b56cdd018a4fb6830d7828519fad
/*
* Copyright (C) 2011 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 <stddef.h>
#include <string.h>
#include <stdio.h>
#include <unistd.h>
#include <errno.h>
#include <dirent.h>
#include <fcntl.h>
#include <syslog.h>
#include <getopt.h>
#include <signal.h>
#include <time.h>
#include "udev.h"
{
}
{
{}
};
char filename[UTIL_PATH_SIZE];
enum udev_builtin_cmd cmd;
int rc = EXIT_SUCCESS;
for (;;) {
int option;
if (option == -1)
break;
switch (option) {
case 'h':
goto out;
}
}
rc = 2;
goto out;
}
rc = 3;
goto out;
}
if (cmd >= UDEV_BUILTIN_MAX) {
rc = 5;
goto out;
}
/* add /sys if needed */
else
rc = 4;
goto out;
}
rc = 6;
}
out:
return rc;
}
const struct udevadm_cmd udevadm_test_builtin = {
.name = "test-builtin",
.cmd = adm_builtin,
.help = "test a built-in command",
.debug = true,
};