[Toybox] [PATCH] Implement tail -f.

enh enh at google.com
Sun Dec 20 09:39:33 PST 2015


ping?

i assume we'll want a follow-up change adding error-checking here:

-  TT.files[TT.file_no].fd = dup(fd);
-  TT.files[TT.file_no].path = strdup(name);
+  TT.files[TT.file_no].fd = xdup(fd);
+  TT.files[TT.file_no].path = xstrdup(name);

and this can probably just use toybuf?

-      #define STR(x) #x
-      char path[sizeof("/proc/self/fd/" STR(INT_MIN))];
-
-      snprintf(path, sizeof(path), "/proc/self/fd/%d", TT.files[i].fd);
-
-      TT.files[i].wd = inotify_add_watch(infd, path, IN_MODIFY);
+      snprintf(toybuf, sizeof(toybuf), "/proc/self/fd/%d", TT.files[i].fd);
+      TT.files[i].wd = inotify_add_watch(infd, toybuf, IN_MODIFY);

but this has already been useful debugging (device-side) adbd bugs...

On Fri, Dec 4, 2015 at 3:17 PM, Josh Gao <jmgao at google.com> wrote:
> Patch attached because I don't trust gmail to not mangle it.
>
> _______________________________________________
> Toybox mailing list
> Toybox at lists.landley.net
> http://lists.landley.net/listinfo.cgi/toybox-landley.net
>



-- 
Elliott Hughes - http://who/enh - http://jessies.org/~enh/
Android native code/tools questions? Mail me/drop by/add me as a reviewer.

 1450633173.0


More information about the Toybox mailing list