Skip to content

Commit

Permalink
Update /dev/clipboard creation for new dyn_dev interface
Browse files Browse the repository at this point in the history
  • Loading branch information
stek29 committed Aug 6, 2019
1 parent 78c329b commit 26884b9
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions app/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,11 @@ - (int)startThings {
generic_mkdirat(AT_PWD, "/dev/pts", 0755);

// Register clipboard device driver and create device node for it
int clipboard_dev_minor = dyn_dev_register(&clipboard_dev, CLIPBOARD_DEV_MINOR);
if (clipboard_dev_minor != CLIPBOARD_DEV_MINOR) {
return clipboard_dev_minor;
err = dyn_dev_register(&clipboard_dev, DYN_DEV_TYPE_CHAR, DYN_DEV_MAJOR, CLIPBOARD_DEV_MINOR);
if (err != 0) {
return err;
}
// XXX(stek29): mknod does nothing if device already exists, but has different major/minor number
// but dyn_dev doesn't guarantee fixed minor number. Consider dynamic minor selection.
generic_mknod("/dev/clipboard", S_IFCHR|0666, dev_make(DYN_DEV_MAJOR, clipboard_dev_minor));
generic_mknod("/dev/clipboard", S_IFCHR|0666, dev_make(DYN_DEV_MAJOR, CLIPBOARD_DEV_MINOR));

do_mount(&procfs, "proc", "/proc", 0);
do_mount(&devptsfs, "devpts", "/dev/pts", 0);
Expand Down

0 comments on commit 26884b9

Please sign in to comment.