Back to index

courier  0.68.2
sqwebmaild.c
Go to the documentation of this file.
00001 /*
00002 ** Copyright 2003-2007 Double Precision, Inc.  See COPYING for
00003 ** distribution information.
00004 */
00005 
00006 
00007 /*
00008 */
00009 #include      "config.h"
00010 #include      "sqwebmail.h"
00011 #include      "htmllibdir.h"
00012 #include      "cgi/cgi.h"
00013 #include      <string.h>
00014 
00015 int main(int argc, char **argv)
00016 {
00017        int    pass_fd;
00018 
00019 
00020        pass_fd=0;
00021 
00022 #if    CGI_PASSFD
00023 
00024        /*
00025        ** If invoked as sqwebmailn, don't pass file descripts.
00026        ** Fallback to proxy mode.
00027        */
00028 
00029        {
00030               const char *p=strrchr(argv[0], '/');
00031 
00032               if (p == NULL) p=argv[0];
00033               else ++p;
00034 
00035               if (strcmp(p, "sqwebmailn"))
00036                      pass_fd=1;
00037        }
00038 #endif
00039 
00040        cgi_connectdaemon(SOCKFILENAME, pass_fd);
00041        return (0);
00042 }