Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 746227 | Differences between
and this patch

Collapse All | Expand All

(-)a/unix/vncserver/vncserver.in (-8 / +18 lines)
Lines 27-34 Link Here
27
# vncserver - wrapper script to start an X VNC server.
27
# vncserver - wrapper script to start an X VNC server.
28
#
28
#
29
29
30
# Get the args
31
my ($display, $xsession) = @ARGV;
32
30
# First make sure we're operating in a sane environment.
33
# First make sure we're operating in a sane environment.
31
&SanityCheck();
34
35
&SanityCheck($xsession);
32
36
33
#
37
#
34
# Global variables.  You may want to configure some of these for
38
# Global variables.  You may want to configure some of these for
Lines 83-89 Link Here
83
}
87
}
84
88
85
# Find display number.
89
# Find display number.
86
if ((@ARGV == 1) && ($ARGV[0] =~ /^:(\d+)$/)) {
90
if ( ( (@ARGV == 1) || (@ARGV == 2) ) && ($ARGV[0] =~ /^:(\d+)$/)) {
87
    $displayNumber = $1;
91
    $displayNumber = $1;
88
    if (!&CheckDisplayNumber($displayNumber)) {
92
    if (!&CheckDisplayNumber($displayNumber)) {
89
	die "A VNC server is already running as :$displayNumber\n";
93
	die "A VNC server is already running as :$displayNumber\n";
Lines 411-423 Link Here
411
415
412
sub Usage
416
sub Usage
413
{
417
{
414
    die("\nusage: $prog <display>\n\n");
418
    die("\nusage: $prog <display> [<xsession-file>]\n\n");
415
}
419
}
416
420
417
421
418
# Routine to make sure we're operating in a sane environment.
422
# Routine to make sure we're operating in a sane environment.
419
sub SanityCheck
423
sub SanityCheck
420
{
424
{
425
    my($xsessionfile) = @_;
426
421
    local ($cmd);
427
    local ($cmd);
422
428
423
    # Get the program name
429
    # Get the program name
Lines 437-448 Link Here
437
	die "$prog: couldn't find \"$cmd\" on your PATH.\n";
443
	die "$prog: couldn't find \"$cmd\" on your PATH.\n";
438
    }
444
    }
439
445
440
    foreach $cmd ("/etc/X11/xinit/Xsession", "/etc/X11/Xsession") {
446
    if (-x "$xsessionfile"){
441
        if (-x "$cmd") {
447
	$Xsession = $xsessionfile
442
            $Xsession = $cmd;
448
    } else {
443
            last;
449
        foreach $cmd ("/etc/X11/xinit/Xsession", "/etc/X11/Xsession") {
450
            if (-x "$cmd") {
451
                $Xsession = $cmd;
452
                last;
453
            }
444
        }
454
        }
445
    }
455
    } 
446
    if (not defined $Xsession) {
456
    if (not defined $Xsession) {
447
        die "$prog: Couldn't find suitable Xsession.\n";
457
        die "$prog: Couldn't find suitable Xsession.\n";
448
    }
458
    }

Return to bug 746227