Skip to content

Commit

Permalink
vncserver: Add -test option to print Xvnc cmd line
Browse files Browse the repository at this point in the history
This is useful in conjunction with gdb or valgrind.

Closes #448
  • Loading branch information
dcommander committed Feb 13, 2025
1 parent 6cd24ef commit 311d82c
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions unix/vncserver.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env perl
#
# Copyright (C) 2009-2018, 2020-2022, 2024 D. R. Commander.
# All Rights Reserved.
# Copyright (C) 2009-2018, 2020-2022, 2024-2025 D. R. Commander.
# All Rights Reserved.
# Copyright (C) 2021 Steffen Kieß
# Copyright (C) 2010 University Corporation for Atmospheric Research.
# All Rights Reserved.
Expand Down Expand Up @@ -213,7 +213,8 @@ foreach $_registrydir (@registrydirs) {
"-3dwm", 0, "-vgl", 0, "-debug", 0, "-x509cert", 1,
"-x509key", 1, "-autokill", 0, "-quiet", 0, "-wm", 1,
"-sessionlist", 0, "-sessionstart", 0, "-novnc", 1,
"-noautokill", 0, "-rfbport", 1, "-rfbunixpath", 1, "-uds", 0);
"-noautokill", 0, "-rfbport", 1, "-rfbunixpath", 1, "-uds", 0,
"-test", 0);

&Usage() if ($opt{'-help'} || $opt{'-h'} || $opt{'--help'});

Expand Down Expand Up @@ -490,6 +491,10 @@ if (!$opt{'-debug'}) {
# Run $cmd and record the process ID.

$pidFile = "$vncUserDir/$host:$displayNumber.pid";
if ($opt{'-test'}) {
print "$cmd\n";
exit;
}
system("$cmd & echo \$! >$pidFile");

# Record the RFB Unix domain socket path
Expand Down

0 comments on commit 311d82c

Please sign in to comment.