ALT Linux Bugzilla
– Attachment 7240 Details for
Bug 30315
race conditions during media detection
New bug
|
Search
|
[?]
|
Help
Register
|
Log In
[x]
|
Forgot Password
Login:
[x]
|
EN
|
RU
[patch]
Два исправления, включая поддержку MMC
my.patch (text/plain), 2.47 KB, created by
Leonid Krivoshein
on 2017-10-20 19:44:34 MSK
(
hide
)
Description:
Два исправления, включая поддержку MMC
Filename:
MIME Type:
Creator:
Leonid Krivoshein
Created:
2017-10-20 19:44:34 MSK
Size:
2.47 KB
patch
obsolete
>commit f0c905f3939e094f7f6971dd84cef14f692b0d92 >Author: Leonid Krivoshein <klark@altlinux.org> >Date: Fri Oct 20 18:33:52 2017 +0300 > > 20171020-alt1 > > - cdrom.c: fixed implicit declaration of function 'opendir' warning. > - probing.c: added support for MMC devices when boot in LiveCD-mode. > >diff --git a/cdrom.c b/cdrom.c >index 6c60730..ba1ae8b 100644 >--- a/cdrom.c >+++ b/cdrom.c >@@ -27,6 +27,8 @@ > #include <stdio.h> > #include <sys/mount.h> > #include <ctype.h> >+#include <dirent.h> >+ > #include "stage1.h" > #include "frontend.h" > #include "modules.h" >diff --git a/probing.c b/probing.c >index 56d1375..b5f2ecd 100644 >--- a/probing.c >+++ b/probing.c >@@ -149,7 +149,7 @@ static void find_media(void) > while ((dirent = readdir(dir)) != NULL) { > if (!strcmp(dirent->d_name, ".") || > !strcmp(dirent->d_name, "..")) continue; >- >+ > memset(path, 0, SYSFS_PATH_MAX); > strcpy(path, "/sys/block/"); > strcat(path, dirent->d_name); >@@ -161,11 +161,15 @@ static void find_media(void) > tmp[count].name = strdup(dirent->d_name); > tmp[count].type = UNKNOWN_MEDIA; > if ((f = fopen(path, "r")) != NULL) { >- int type; >- if (fgets(buf, sizeof(buf), f) && sscanf(buf, "%d", &type)) { >- if (type == SCSI_TYPE_DISK) tmp[count].type = DISK; >- else if (type == SCSI_TYPE_ROM) tmp[count].type = CDROM; >- else if (type == SCSI_TYPE_TAPE) tmp[count].type = TAPE; >+ int type = SCSI_TYPE_DISK; >+ if (fgets(buf, sizeof(buf), f) > 0) { >+ if (strncmp(buf, "MMC", 3) == 0) >+ tmp[count].type = DISK; >+ else if (sscanf(buf, "%d", &type) > 0) { >+ if (type == SCSI_TYPE_DISK) tmp[count].type = DISK; >+ else if (type == SCSI_TYPE_ROM) tmp[count].type = CDROM; >+ else if (type == SCSI_TYPE_TAPE) tmp[count].type = TAPE; >+ } > } > fclose(f); > } >diff --git a/propagator.spec b/propagator.spec >index cb34b2e..103e759 100644 >--- a/propagator.spec >+++ b/propagator.spec >@@ -2,7 +2,7 @@ > %def_with splash > > Name: propagator >-Version: 20170511 >+Version: 20171020 > Release: alt1 > > Summary: 'Early userspace' set of binaries >@@ -37,6 +37,10 @@ including init and various helpers for hw probing and bootstrapping. > %_sbindir/propagator > > %changelog >+* Fri Oct 20 2017 Leonid Krivoshein <klark@altlinux.org> 20171020-alt1 >+- cdrom.c: fixed implicit declaration of function 'opendir' warning. >+- probing.c: added support for MMC devices when boot in LiveCD-mode. >+ > * Thu May 11 2017 Gleb F-Malinovskiy <glebfm@altlinux.org> 20170511-alt1 > - Fixed errors found by cppcheck. >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 30315
:
6142
|
6143
|
6963
|
6964
|
6965
| 7240