diff options
author | Matthieu Herrb <matthieu@herrb.eu> | 2015-12-01 19:15:50 +0100 |
---|---|---|
committer | Matthieu Herrb <matthieu@herrb.eu> | 2015-12-21 16:30:16 +0100 |
commit | 82298bc7aa1b1715adce9de1cf61c6335bc659d8 (patch) | |
tree | 585c4bc82f426fb77d6e16a737b37cc983968536 | |
parent | c0c3ad0cc5a6e5cf528245fb7f4e47b91163333c (diff) |
Remove #if 0'd code
Signed-off-by: Matthieu Herrb <matthieu@herrb.eu>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r-- | chooser/chooser.c | 37 | ||||
-rw-r--r-- | include/dm.h | 3 | ||||
-rw-r--r-- | xdm/choose.c | 11 | ||||
-rw-r--r-- | xdm/dm.c | 25 | ||||
-rw-r--r-- | xdm/xdmcp.c | 81 |
5 files changed, 0 insertions, 157 deletions
diff --git a/chooser/chooser.c b/chooser/chooser.c index bbcf80c..6ebf2cc 100644 --- a/chooser/chooser.c +++ b/chooser/chooser.c @@ -406,28 +406,6 @@ DisposeHostname (HostName *host) free (host); } -#if 0 -static void -RemoveHostname (HostName *host) -{ - HostName **prev, *hosts; - - prev = &hostNamedb; - for (hosts = hostNamedb; hosts; hosts = hosts->next) - { - if (hosts == host) - break; - prev = &hosts->next; - } - if (!hosts) - return; - *prev = host->next; - DisposeHostname (host); - NameTableSize--; - RebuildTable (NameTableSize); -} -#endif - static void EmptyHostnames (void) { @@ -674,21 +652,6 @@ RegisterHostname (char *name) static ARRAYofARRAY8 AuthenticationNames; -#if 0 -static void -RegisterAuthenticationName (char *name, int namelen) -{ - ARRAY8Ptr authName; - if (!XdmcpReallocARRAYofARRAY8 (&AuthenticationNames, - AuthenticationNames.length + 1)) - return; - authName = &AuthenticationNames.data[AuthenticationNames.length-1]; - if (!XdmcpAllocARRAY8 (authName, namelen)) - return; - memmove( authName->data, name, namelen); -} -#endif - static int InitXDMCP (char **argv) { diff --git a/include/dm.h b/include/dm.h index 4497f4e..13e7839 100644 --- a/include/dm.h +++ b/include/dm.h @@ -406,9 +406,6 @@ extern int NetaddrFamily (XdmcpNetaddr netaddrp); extern int addressEqual (XdmcpNetaddr a1, int len1, XdmcpNetaddr a2, int len2); /* in policy.c */ -# if 0 -extern ARRAY8Ptr Accept (/* struct sockaddr *from, int fromlen, CARD16 displayNumber */); -# endif extern ARRAY8Ptr ChooseAuthentication (ARRAYofARRAY8Ptr authenticationNames); extern int CheckAuthentication (struct protoDisplay *pdpy, ARRAY8Ptr displayID, ARRAY8Ptr name, ARRAY8Ptr data); extern int SelectAuthorizationTypeIndex (ARRAY8Ptr authenticationName, ARRAYofARRAY8Ptr authorizationNames); diff --git a/xdm/choose.c b/xdm/choose.c index 1f769fe..2d9aabd 100644 --- a/xdm/choose.c +++ b/xdm/choose.c @@ -295,25 +295,14 @@ RegisterIndirectChoice ( { ChoicePtr c; int insert; -# if 0 - int found = 0; -# endif Debug ("Got indirect choice back\n"); for (c = choices; c; c = c->next) { if (XdmcpARRAY8Equal (clientAddress, &c->client) && connectionType == c->connectionType) { -# if 0 - found = 1; -# endif break; } } -# if 0 - if (!found) - return 0; -# endif - insert = 0; if (!c) { @@ -1045,31 +1045,6 @@ RemovePid (void) _SysErrorMsg (errno)); } -#if 0 -void -UnlockPidFile (void) -{ - if (lockPidFile) -# ifdef F_SETLK - { - struct flock lock_data; - lock_data.l_type = F_UNLCK; - lock_data.l_whence = SEEK_SET; - lock_data.l_start = lock_data.l_len = 0; - (void) fcntl(pidFd, F_SETLK, &lock_data); - } -# else -# ifdef F_ULOCK - lockf (pidFd, F_ULOCK, 0); -# else - flock (pidFd, LOCK_UN); -# endif -# endif - close (pidFd); - fclose (pidFilePtr); -} -#endif - #ifndef HAVE_SETPROCTITLE void SetTitle (char *name, ...) { diff --git a/xdm/xdmcp.c b/xdm/xdmcp.c index 14fb940..b56e588 100644 --- a/xdm/xdmcp.c +++ b/xdm/xdmcp.c @@ -1470,85 +1470,4 @@ NetworkAddressToHostname ( return name; } -# if 0 -static int -HostnameToNetworkAddress ( -char *name, -CARD16 connectionType, -ARRAY8Ptr connectionAddress) -{ - switch (connectionType) - { - case FamilyInternet: - { - struct hostent *hostent; - - hostent = gethostbyname (name); - if (!hostent) - return FALSE; - if (!XdmcpAllocARRAY8 (connectionAddress, hostent->h_length)) - return FALSE; - memmove( connectionAddress->data, hostent->h_addr, hostent->h_length); - return TRUE; - } - } - return FALSE; -} - -/* - * converts a display name into a network address, using - * the same rules as XOpenDisplay (algorithm cribbed from there) - */ -static int -NameToNetworkAddress( -char *name, -CARD16Ptr connectionTypep, -ARRAY8Ptr connectionAddress, -CARD16Ptr displayNumber) -{ - char *colon, *display_number; - char hostname[1024]; - int dnet = FALSE; - CARD16 number; - CARD16 connectionType; - - colon = strchr(name, ':'); - if (!colon) - return FALSE; - if (colon != name) - { - if (colon - name > sizeof (hostname)) - return FALSE; - strncpy (hostname, name, colon - name); - hostname[colon - name] = '\0'; - } - else - { - strcpy (hostname, localHostname ()); - } - if (colon[1] == ':') - { - dnet = TRUE; - colon++; - } - if (dnet) - return FALSE; - display_number = colon + 1; - while (*display_number && *display_number != '.') - { - if (!isascii (*display_number) || !isdigit(*display_number)) - return FALSE; - } - if (display_number == colon + 1) - return FALSE; - number = atoi (colon + 1); - connectionType = FamilyInternet; - if (!HostnameToNetworkAddress (hostname, connectionType, connectionAddress)) - return FALSE; - *displayNumber = number; - *connectionTypep = connectionType; - return TRUE; -} -# endif - #endif /* XDMCP */ |