am f53d99f1: am 0c4a89bb: Fix dhcp renew behavior

* commit 'f53d99f1bb925b332a2abbca5abd463795508a50':
  Fix dhcp renew behavior
diff --git a/Android.mk b/Android.mk
index 3ced2e9..68e2166 100644
--- a/Android.mk
+++ b/Android.mk
@@ -1,5 +1,4 @@
 # Copyright 2006 The Android Open Source Project
-ifneq ($(TARGET_SIMULATOR),true)
 LOCAL_PATH:= $(call my-dir)
 
 etc_dir := $(TARGET_OUT)/etc/dhcpcd
@@ -57,5 +56,3 @@
 LOCAL_MODULE_PATH := $(hooks_target)
 LOCAL_SRC_FILES := $(hooks_dir)/$(LOCAL_MODULE)
 include $(BUILD_PREBUILT)
-
-endif
diff --git a/dhcpcd.c b/dhcpcd.c
index 791f513..df3e790 100644
--- a/dhcpcd.c
+++ b/dhcpcd.c
@@ -1905,9 +1905,14 @@
 		char pidpropname[PROPERTY_KEY_MAX];
 		char pidpropval[PROPERTY_VALUE_MAX];
 
+		if (optind != argc - 1) {
+			syslog(LOG_ERR, "Android requires an interface");
+			exit(EXIT_FAILURE);
+		}
+
 		if (snprintf(pidpropname,
 			     sizeof(pidpropname),
-			     "dhcp.%s.pid", iface->name) >= PROPERTY_KEY_MAX)
+			     "dhcp.%s.pid", argv[optind]) >= PROPERTY_KEY_MAX)
 			exit(EXIT_FAILURE);
 		property_get(pidpropname, pidpropval, NULL);
 		if (strlen(pidpropval) == 0)
@@ -1985,9 +1990,14 @@
 		if (set_cloexec(pidfd) == -1)
 			exit(EXIT_FAILURE);
 #ifdef ANDROID
+		if (optind != argc - 1) {
+			syslog(LOG_ERR, "Android requires an interface");
+			exit(EXIT_FAILURE);
+		}
+
 		if (snprintf(pidpropname,
 			     sizeof(pidpropname),
-			     "dhcp.%s.pid", iface->name) >= PROPERTY_KEY_MAX)
+			     "dhcp.%s.pid", argv[optind]) >= PROPERTY_KEY_MAX)
 			exit(EXIT_FAILURE);
 		if (snprintf(pidpropval, sizeof(pidpropval), "%d", getpid()) >= PROPERTY_VALUE_MAX)
 			exit(EXIT_FAILURE);