Advertisement
Guest User

Untitled

a guest
Jul 12th, 2013
259
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.83 KB | None | 0 0
  1. diff --git a/src/weston-launch.c b/src/weston-launch.c
  2. index 4c07d8e..7bb8cc7 100644
  3. --- a/src/weston-launch.c
  4. +++ b/src/weston-launch.c
  5. @@ -510,7 +510,8 @@ setup_tty(struct weston_launch *wl, const char *tty)
  6. static void
  7. help(const char *name)
  8. {
  9. - fprintf(stderr, "Usage: %s [args...] [-- [weston args..]]\n", name);
  10. + fprintf(stderr, "Usage: %s [args...] [-- [server args..]]\n", name);
  11. + fprintf(stderr, " -b, --binary Wayland Server to use\n");
  12. fprintf(stderr, " -u, --user Start session as specified username\n");
  13. fprintf(stderr, " -t, --tty Start session on alternative tty\n");
  14. fprintf(stderr, " -v, --verbose Be verbose\n");
  15. @@ -525,10 +526,11 @@ main(int argc, char *argv[])
  16. char **env;
  17. int i, c;
  18. char *child_argv[MAX_ARGV_SIZE];
  19. - char *tty = NULL, *new_user = NULL;
  20. + char *tty = NULL, *new_user = NULL, *binary =NULL;
  21. char *term;
  22. int sleep_fork = 0;
  23. struct option opts[] = {
  24. + { "binary", optional_argument, NULL, 'b' },
  25. { "user", required_argument, NULL, 'u' },
  26. { "tty", required_argument, NULL, 't' },
  27. { "verbose", no_argument, NULL, 'v' },
  28. @@ -539,8 +541,14 @@ main(int argc, char *argv[])
  29.  
  30. memset(&wl, 0, sizeof wl);
  31.  
  32. - while ((c = getopt_long(argc, argv, "u:t:s::vh", opts, &i)) != -1) {
  33. + while ((c = getopt_long(argc, argv, "b:u:t:s::vh", opts, &i)) != -1) {
  34. switch (c) {
  35. + case 'b':
  36. + if (optarg)
  37. + binary = optarg;
  38. + else
  39. + binary = "weston";
  40. + break;
  41. case 'u':
  42. new_user = optarg;
  43. if (getuid() != 0)
  44. @@ -578,7 +586,7 @@ main(int argc, char *argv[])
  45. child_argv[1] = "-l";
  46. child_argv[2] = "-c";
  47. child_argv[3] = BINDIR "/weston \"$@\"";
  48. - child_argv[4] = "weston";
  49. + child_argv[4] = binary;
  50. for (i = 0; i < (argc - optind); ++i)
  51. child_argv[5 + i] = argv[optind + i];
  52. child_argv[5 + i] = NULL;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement