head	1.2;
access;
symbols
	RELEASE_7_0_0:1.1
	RELEASE_6_3_0:1.1
	PRE_XORG_7:1.1
	RELEASE_4_EOL:1.1
	RELEASE_6_2_0:1.1
	RELEASE_6_1_0:1.1
	RELEASE_5_5_0:1.1
	RELEASE_6_0_0:1.1
	RELEASE_5_4_0:1.1;
locks; strict;
comment	@# @;


1.2
date	2008.04.25.23.21.09;	author pav;	state dead;
branches;
next	1.1;

1.1
date	2005.02.16.07.03.32;	author brooks;	state Exp;
branches;
next	;


desc
@@


1.2
log
@- Remove, it's ancient and newer version is included in base of all supported
  releases

Suggested by:	sam
@
text
@--- wpa_supplicant.c.orig	Sat Feb  5 15:51:25 2005
+++ wpa_supplicant.c	Wed Feb 16 01:16:55 2005
@@@@ -32,6 +32,9 @@@@
 #endif /* CONFIG_NATIVE_WINDOWS */
 #include <fcntl.h>
 
+#include <sys/param.h>
+#include <paths.h>
+
 #define OPENSSL_DISABLE_OLD_DES_SUPPORT
 #include "common.h"
 #include "eapol_sm.h"
@@@@ -2285,12 +2288,43 @@@@
 	wpa_supplicant_cleanup(wpa_s);
 }
 
+static	const char*	pid_filename = _PATH_VARRUN "wpa_supplicant.pid";
+
+static
+void
+remove_pid_file(void) {
+	unlink(pid_filename);
+}
+
+static
+void
+create_pidfile(const char* path_pid_file) {
+	FILE*	fd;
+
+	if (path_pid_file) {
+		pid_filename = path_pid_file;
+	}
+
+	fd = fopen(pid_filename, "w");
+	if (fd) {
+		pid_t	pid;
+
+		pid = getpid();
+
+		fprintf(fd, "%ld\n", pid);
+		fclose(fd);
+
+		atexit(remove_pid_file);
+	}
+}
+
 
 int main(int argc, char *argv[])
 {
 	struct wpa_supplicant *head, *wpa_s;
 	int c;
 	const char *confname, *driver, *ifname;
+	const char *path_pid_file = NULL;
 	int daemonize = 0, wait_for_interface = 0, disable_eapol = 0, exitcode;
 
 #ifdef CONFIG_NATIVE_WINDOWS
@@@@ -2312,7 +2346,7 @@@@
 	ifname = confname = driver = NULL;
 
 	for (;;) {
-		c = getopt(argc, argv, "Bc:D:dehi:KLNqtvw");
+		c = getopt(argc, argv, "Bc:D:dehi:KLNp:qtvw");
 		if (c < 0)
 			break;
 		switch (c) {
@@@@ -2347,6 +2381,9 @@@@
 		case 'L':
 			license();
 			return -1;
+		case 'p':
+			path_pid_file = optarg;
+			break;
 		case 'q':
 			wpa_debug_level++;
 			break;
@@@@ -2405,6 +2442,10 @@@@
 			exitcode = -1;
 			goto cleanup;
 		}
+	}
+
+	if (daemonize) {
+		create_pidfile(path_pid_file);
 	}
 
 	eloop_register_signal(SIGINT, wpa_supplicant_terminate, NULL);
@


1.1
log
@- Update to 0.3.8.  See ChangeLog for details.
- Install sample config file in etc/wpa_supplication.conf.sample instead
  of DOCSDIR.
- Obey PREFIX.
- Follow move of binaries from bin to sbin.

Committed from a laptop running this version against an AP with WPA-PSK
and AES encription.

Submitted by:	Yamamoto Shigeru <shigeru at iij dot ad dot jp>
PR:		75609 (by Rong-En Fan <rafan at infor dot org>)
@
text
@@

