Clarify control flow in inotify read loop
authorSteven Luo <steven+maemo@steven676.net>
Tue, 16 Feb 2010 02:50:01 +0000 (18:50 -0800)
committerSteven Luo <steven+maemo@steven676.net>
Tue, 16 Feb 2010 02:50:01 +0000 (18:50 -0800)
Replace pointer arithmetic that makes the loop condition false with a
simple break; functionally equivalent, but much clearer.

launcher.c

index 45ce750..9d2953b 100644 (file)
@@ -381,7 +381,7 @@ void launch_microb(struct swb_context *ctx, char *uri) {
                                        pos += len;
                                else
                                        /* All events processed */
                                        pos += len;
                                else
                                        /* All events processed */
-                                       pos = buf + bytes_read;
+                                       break;
                        }
                        if (!pos)
                                /* Event found, stop looking */
                        }
                        if (!pos)
                                /* Event found, stop looking */