Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a new UeventSender.sender object for every uevent call #255

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions src/umockdev.vala
Original file line number Diff line number Diff line change
Expand Up @@ -825,11 +825,10 @@ public class Testbed: GLib.Object {
*/
public void uevent (string devpath, string action)
{
if (this.ev_sender == null) {
debug("umockdev_testbed_uevent: lazily initializing uevent_sender");
this.ev_sender = new UeventSender.sender(this.root_dir);
assert(this.ev_sender != null);
}
UeventSender.sender ev_sender = null;
ev_sender = new UeventSender.sender(this.root_dir);
assert(ev_sender != null);

debug("umockdev_testbed_uevent: sending uevent %s for device %s", action, devpath);

var uevent_path = Path.build_filename(this.root_dir, devpath, "uevent");
Expand All @@ -839,7 +838,7 @@ public class Testbed: GLib.Object {
} catch (FileError e) {
debug("uevent: devpath %s has no uevent file: %s", devpath, e.message);
}
this.ev_sender.send(devpath, action, properties);
ev_sender.send(devpath, action, properties);
}

/**
Expand Down Expand Up @@ -1660,7 +1659,6 @@ public class Testbed: GLib.Object {
private Regex re_record_val;
private Regex re_record_keyval;
private Regex re_record_optval;
private UeventSender.sender? ev_sender = null;
private HashTable<string,int> dev_fd;
private HashTable<string,ScriptRunner> dev_script_runner;
private SocketServer socket_server = null;
Expand Down