From 12154200a76e70f5da0f135abf5ffe060f35a785 Mon Sep 17 00:00:00 2001 From: Koushik Dutta Date: Thu, 11 Nov 2010 01:16:14 -0800 Subject: [PATCH] fix up implementation of int get_partition_device Change-Id: I142b15228322790892dd07b10d6a3f31440badc7 --- mmcutils/mmcutils.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mmcutils/mmcutils.c b/mmcutils/mmcutils.c index f0cdf8c..2c10343 100644 --- a/mmcutils/mmcutils.c +++ b/mmcutils/mmcutils.c @@ -579,12 +579,13 @@ int mount_partition(const char *partition, const char *mount_point, const char * return mmc_mount_partition(p, mount_point, read_only); } -const char* get_partition_device(const char *partition) +int get_partition_device(const char *partition, char *device) { mmc_scan_partitions(); const MmcPartition *p; p = mmc_find_partition_by_name(partition); if (p == NULL) - return NULL; - return p->device_index; + return -1; + strcpy(device, p->device_index); + return 0; }