move the test root user check back to right place
@@ -165,6 +165,10 @@ sub new_memcached {
croak("Failed to connect to specified memcached server.") unless $conn;
}
+ if ($< == 0) {
+ $args .= " -u root";
+ }
+
my $udpport;
if ($args =~ /-l (\S+)/) {
$port = free_port();
@@ -173,9 +177,6 @@ sub new_memcached {
if (supports_udp()) {
$args .= " -U $udpport";
}
- if ($< == 0) {
- $args .= " -u root";
- }
} elsif ($args !~ /-s (\S+)/) {
my $num = @unixsockets;
my $file = "/tmp/memcachetest.$$.$num";
