Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/src/weston-launch.c b/src/weston-launch.c
- index 4c07d8e..7bb8cc7 100644
- --- a/src/weston-launch.c
- +++ b/src/weston-launch.c
- @@ -510,7 +510,8 @@ setup_tty(struct weston_launch *wl, const char *tty)
- static void
- help(const char *name)
- {
- - fprintf(stderr, "Usage: %s [args...] [-- [weston args..]]\n", name);
- + fprintf(stderr, "Usage: %s [args...] [-- [server args..]]\n", name);
- + fprintf(stderr, " -b, --binary Wayland Server to use\n");
- fprintf(stderr, " -u, --user Start session as specified username\n");
- fprintf(stderr, " -t, --tty Start session on alternative tty\n");
- fprintf(stderr, " -v, --verbose Be verbose\n");
- @@ -525,10 +526,11 @@ main(int argc, char *argv[])
- char **env;
- int i, c;
- char *child_argv[MAX_ARGV_SIZE];
- - char *tty = NULL, *new_user = NULL;
- + char *tty = NULL, *new_user = NULL, *binary =NULL;
- char *term;
- int sleep_fork = 0;
- struct option opts[] = {
- + { "binary", optional_argument, NULL, 'b' },
- { "user", required_argument, NULL, 'u' },
- { "tty", required_argument, NULL, 't' },
- { "verbose", no_argument, NULL, 'v' },
- @@ -539,8 +541,14 @@ main(int argc, char *argv[])
- memset(&wl, 0, sizeof wl);
- - while ((c = getopt_long(argc, argv, "u:t:s::vh", opts, &i)) != -1) {
- + while ((c = getopt_long(argc, argv, "b:u:t:s::vh", opts, &i)) != -1) {
- switch (c) {
- + case 'b':
- + if (optarg)
- + binary = optarg;
- + else
- + binary = "weston";
- + break;
- case 'u':
- new_user = optarg;
- if (getuid() != 0)
- @@ -578,7 +586,7 @@ main(int argc, char *argv[])
- child_argv[1] = "-l";
- child_argv[2] = "-c";
- child_argv[3] = BINDIR "/weston \"$@\"";
- - child_argv[4] = "weston";
- + child_argv[4] = binary;
- for (i = 0; i < (argc - optind); ++i)
- child_argv[5 + i] = argv[optind + i];
- child_argv[5 + i] = NULL;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement