libaacs | branch: master | npzacs <[email protected]> | Mon Sep 27 18:49:05 2010 +0300| [29cd842791f88e16cf217e20ff74f9cea21aa5f7] | committer: npzacs
mmc_open(): moved generic code (copying keys) outside of #ifdef HAVE_MNTENT_H > http://git.videolan.org/gitweb.cgi/libaacs.git/?a=commit;h=29cd842791f88e16cf217e20ff74f9cea21aa5f7 --- src/libaacs/mmc.c | 21 ++++++++++++++------- 1 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/libaacs/mmc.c b/src/libaacs/mmc.c index d46f6f5..bd5c48a 100644 --- a/src/libaacs/mmc.c +++ b/src/libaacs/mmc.c @@ -262,17 +262,20 @@ MMC *mmc_open(const char *path, const uint8_t *host_priv_key, const uint8_t *host_cert, const uint8_t *host_nonce, const uint8_t *host_key_point) { -#ifdef HAVE_MNTENT_H - char *file_path = (char*)malloc(strlen(path) + 1); - strcpy(file_path, path); - int path_len = strlen(file_path); - FILE *proc_mounts; MMC *mmc = malloc(sizeof(MMC)); if (host_priv_key) memcpy(mmc->host_priv_key, host_priv_key, 20); if (host_cert) memcpy(mmc->host_cert, host_cert, 92); if (host_nonce) memcpy(mmc->host_nonce, host_nonce, 20); if (host_key_point) memcpy(mmc->host_key_point, host_key_point, 40); + +#ifdef HAVE_MNTENT_H + + char *file_path = (char*)malloc(strlen(path) + 1); + strcpy(file_path, path); + int path_len = strlen(file_path); + FILE *proc_mounts; + mmc->fd = -1; // strip trailing '/'s @@ -308,10 +311,14 @@ MMC *mmc_open(const char *path, const uint8_t *host_priv_key, X_FREE(mmc); } - return mmc; +#else + + DEBUG(DBG_MMC, "No MMC drive support !\n"); + X_FREE(mmc); + #endif - return NULL; + return mmc; } void mmc_close(MMC *mmc) _______________________________________________ libaacs-devel mailing list [email protected] http://mailman.videolan.org/listinfo/libaacs-devel
