diff options
author | Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> | 2009-01-21 18:21:03 -0200 |
---|---|---|
committer | Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> | 2009-01-21 18:21:03 -0200 |
commit | be1c0624824ab7bd52d9f417a73a80dd8bb0820d (patch) | |
tree | c385c7f7f1bd93109e44cfc30e6dd9804efa6f8e | |
parent | 4115bdcae1a73543900118230a421da2710af836 (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.c | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -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); |