summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>2009-01-21 18:21:03 -0200
committerPaulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>2009-01-21 18:21:03 -0200
commitbe1c0624824ab7bd52d9f417a73a80dd8bb0820d (patch)
treec385c7f7f1bd93109e44cfc30e6dd9804efa6f8e
parent4115bdcae1a73543900118230a421da2710af836 (diff)
Query the "default" local server if none specified.
If no server specified, and the documented environment variable is not set, attempt to connect to the local font server, as configured by most Linux distributions for several years.
-rw-r--r--xfsinfo.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/xfsinfo.c b/xfsinfo.c
index f1ea02d..dd02096 100644
--- a/xfsinfo.c
+++ b/xfsinfo.c
@@ -100,12 +100,16 @@ main(int argc, char *argv[])
if (!svr) {
if (FSServerName(servername) == NULL) {
- fprintf(stderr, "%s: no font server defined\n", progname);
+ if ((svr = FSOpenServer("unix/:-1")) == NULL) {
+ fprintf(stderr, "%s: no font server defined\n", progname);
+ exit(1);
+ }
+ }
+ if (!svr) {
+ fprintf(stderr, "%s: unable to open server \"%s\"\n",
+ progname, FSServerName(servername));
exit(1);
}
- fprintf(stderr, "%s: unable to open server \"%s\"\n",
- progname, FSServerName(servername));
- exit(1);
}
print_server_info(svr);
FSCloseServer(svr);