lkml.org 
[lkml]   [2011]   [May]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] fix depmod to handle passing 3.0 version numbers
depmod with a 3.x version number passed in breaks since it's
testing for 3.x.y still, fix that.

(I can confirm it works and fixes modules.dep generation during fedora
package builds.)

Signed-off-by: Kyle McMartin <kmcmartin@redhat.com>
---
diff --git a/depmod.c b/depmod.c
index abfb11e..853b52b 100644
--- a/depmod.c
+++ b/depmod.c
@@ -245,9 +245,16 @@ static const struct option options[] = { { "all", 0, NULL, 'a' },
/* Version number or module name? Don't assume extension. */
static int is_version_number(const char *version)
{
- unsigned int dummy;
+ int ret;
+ unsigned int major, dummy;

- return (sscanf(version, "%u.%u.%u", &dummy, &dummy, &dummy) == 3);
+ ret = sscanf(version, "%u.%u", &major, &dummy);
+ if ((major == 3) && (ret == 2))
+ return 1;
+
+ ret = sscanf(version, "%u.%u.%u", &dummy, &dummy, &dummy);
+
+ return (ret == 3);
}

static int old_module_version(const char *version)

\
 
 \ /
  Last update: 2011-05-30 15:35    [W:0.022 / U:0.324 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site