1 /* This file is part of the Project Athena Zephyr Notification System.
2 * It is one of the source files comprising zwgc, the Zephyr WindowGram
5 * Created by: Marc Horowitz <marc@athena.mit.edu>
7 * $Id: browser.c,v 1.4 1999/01/22 23:20:10 ghudson Exp $
9 * Copyright (c) 1989 by the Massachusetts Institute of Technology.
10 * For copying and distribution information, see the file
14 #if (!defined(lint) && !defined(SABER))
15 static char rcsid_browser_c[] = "$Id: browser.c,v 1.4 1999/01/22 23:20:10 ghudson Exp $";
18 #include <zephyr/mit-copyright.h>
21 #include <sys/socket.h>
25 static int browser_fd;
26 struct sockaddr_un sun;
33 if ((fd=socket(PF_UNIX,SOCK_STREAM,0)) == -1)
36 sun.sun_family=AF_UNIX;
37 if (temp=getenv("WGSOCK"))
38 strncpy(sun.sunpath,temp,sizeof(sun.sunpath));
40 sprintf(sun.sun_path,"/tmp/.zwgc.%d",getuid());
41 if (bind(fd,(struct sockaddr *) &sun,
42 (len=strlen(sun.sunpath)) > sizeof(sun.sunpath)?
43 sizeof(sun.sunpath):len) == -1) {
48 if (listen(fd,5) == -1) {