/* This file is part of the Project Athena Zephyr Notification System. * It contains source for the ZOpenPort function. * Created by: Robert French * Copyright (c) 1987 by the Massachusetts Institute of Technology. * For copying and distribution information, see the file struct sockaddr_in bindin; if ((__Zephyr_fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { setsockopt(__Zephyr_fd, SOL_SOCKET, SO_BSDCOMPAT, (char *)&on, bindin.sin_family = AF_INET; bindin.sin_addr.s_addr = INADDR_ANY; if (bind(__Zephyr_fd, (struct sockaddr *)&bindin, sizeof(bindin)) < 0) { if (errno == EADDRINUSE && port && *port) if (getsockname(__Zephyr_fd, (struct sockaddr *)&bindin, &len)) __Zephyr_port = bindin.sin_port;