Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ad814559 authored by Takaya Saeki's avatar Takaya Saeki
Browse files

ueventd: parse seqnum field of a uevent

Seqnum field is a unique ID of a uevent. This change lets
uevent_listener to parse it, which is useful to identify uevents with
the same paths.

Bug: 400592897
Test: Cuttlefish boots and uevent is parsed correctly
Change-Id: I0d4e3e75320440c14895de52a824617a9a536356
parent e438de70
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@ struct Uevent {
    int partition_num;
    int major;
    int minor;
    long long seqnum;
};

}  // namespace init
+4 −1
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ static void ParseEvent(const char* msg, Uevent* uevent) {
    uevent->partition_num = -1;
    uevent->major = -1;
    uevent->minor = -1;
    uevent->seqnum = -1;
    uevent->action.clear();
    uevent->path.clear();
    uevent->subsystem.clear();
@@ -41,7 +42,6 @@ static void ParseEvent(const char* msg, Uevent* uevent) {
    uevent->partition_name.clear();
    uevent->device_name.clear();
    uevent->modalias.clear();
    // currently ignoring SEQNUM
    while (*msg) {
        if (!strncmp(msg, "ACTION=", 7)) {
            msg += 7;
@@ -67,6 +67,9 @@ static void ParseEvent(const char* msg, Uevent* uevent) {
        } else if (!strncmp(msg, "PARTN=", 6)) {
            msg += 6;
            uevent->partition_num = atoi(msg);
        } else if (!strncmp(msg, "SEQNUM=", 7)) {
            msg += 7;
            uevent->seqnum = atoll(msg);
        } else if (!strncmp(msg, "PARTNAME=", 9)) {
            msg += 9;
            uevent->partition_name = msg;