Patch to remove goto from sandbox.c

-----BEGIN PGP SIGNED MESSAGE----- Hash: RIPEMD160 Hi, I changed a function in sandbox.c to not use a goto statement. I didn't understood what use it had. Attached the patch file. I did the usual tests and didn't found any error at first and second glance. Please consider to test it yourself and if fit include it into production. best regards Hartmut PS: I try to remove some more gotos, if this patch is ok. - -- Ideas are the only things that can change the world. The rest is details. -- Scott Adams https://netzpolitik.org/2013/anleitung-so-verschlusselt-ihr-eure-e-mails-mit... new Key ID since 26.07.13: 0xD8C361E6 Fingerprint: E5B3 302B 1BE1 D0B4 F190 E739 A365 60A9 D8C3 61E6 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAEBAwAGBQJTEgcdAAoJEKNlYKnYw2Hm9CwP/37Jijgz4By5Au/xkzWUiUWr gRPNTswPZNKhZotgWNYvxQ3SJjhI0pKdFZicX3XUIMUCVJ5wFNT/4Edq3QdDsNGk CorJ+J/UcuzpCQomqJ+zOj6Av+pNSe6/Nbpf8NOgNjAhF1fsqQNQb2/IuSwmqppy YbVl8noNLk6cEb283xLWjwIVNPPTi1Nj0jDFh25ZVxGYcICkDUG6jDjhHNCAZJgG mQEbvq6kBNeh5qX7KPmxhI7fSBh6kTFTLWxLAbYXJQFugqf1ho7T/ULFNOEFDu3e edijtSfk1ysJ0bd9UoUfkD5cJ4fralgIH8mXhlntOxJpwL640g7Gla/bIpsiwrPW XnBGM+qUrhd1HMLZVyVGBAysz+AIOFGYBSC4ZBGG4r2hDStakFHUJ5pNLJYY6EbA NAh03yf8XtPnCM17dojBXvQK1KEXsl0St4ChcERp0uq1v/7d3MLNtM+h1iGhFacT YQyUuZvbvaRoQp7bQUdLjnlRZHhGySwQnzU1T1hY3dxp/182GAGy/SxaWdG+NNsi mVcxLJedzxm4Fx+cARPHLYDU3xPM7EPYSa81eOEUrniVJYx1LiacDSoVRlhfRQiU +8mEs/eaOJJzaooSq/msYiTfFRh4bAu999nk+VHUo+9m9cjjp0sfzPSGNaBkg7dP BLKg6P6uM8sDlOd3yZ4b =g1L7 -----END PGP SIGNATURE-----

Hartmut Prochaska:
I changed a function in sandbox.c to not use a goto statement. I didn't understood what use it had. Attached the patch file.
See <https://www.kernel.org/doc/Documentation/CodingStyle>, Chapter 7, “Centralized exiting of functions” for a rationale. -- Lunar <lunar@torproject.org>

-----BEGIN PGP SIGNED MESSAGE----- Hash: RIPEMD160 Hi,
See <https://www.kernel.org/doc/Documentation/CodingStyle>, Chapter 7, “Centralized exiting of functions” for a rationale.
I saw some functions where the idea above seems fitting. But there had also been some code parts, like this from the sandbox, where it didn't made any sense to me. Like in the lines 1012, 1055, 1098 and 1138 of sandbox.c where we could just also use a break statement to leave the while loops. For the lines 1273, 1278, 1284, 1290 and 1296 of sandbox.c I could understand the use of goto, although it would also work with "else if" very well. It had been just an idea to improve the code base, although only from my point of view as it seems :) Then I just keep reading the source code to understand it and somtimes also contribute to it, I hope. bye Hartmut - -- Ideas are the only things that can change the world. The rest is details. -- Scott Adams https://netzpolitik.org/2013/anleitung-so-verschlusselt-ihr-eure-e-mails-mit... new Key ID since 26.07.13: 0xD8C361E6 Fingerprint: E5B3 302B 1BE1 D0B4 F190 E739 A365 60A9 D8C3 61E6 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAEBAwAGBQJTEimgAAoJEKNlYKnYw2HmuVkQALezNtRJKgtFVyjMV/BeO94t vi4DSNwlcFwEJ3r5aKfm9Pr0DemqwWDf1AfyZx/wUf7ffehfDtQzuReKk/7vqd/E E0VvbhHdGBMu0KqUyLRt2z4+Vc0gsvdkQ38iBb5XdlE0cqImVDSSa+WI350MkOQN KPnKqzxeqmRz2Wqxag1wmDr5RecYMEn6XQpL2QvkjWEfJAVWVh5b1rH73gkorhK6 vr7kCSOpPCYJvZKDb1XJj4XMVO45DcjxtKZ84WfZRULZ8lBpBMO0bymtg7E8/Qi0 kh7VApUsB8tJg7ZlKeMq3k1zHIouIQDn77bVADKqmPG6l105ysBAJypA6Tr3PrhX 1H0j8+ryuxN49bQ9EXZ8RGzghKQtVA+mp/IS7nIrMh9rV+8gMQYrvw9RlZeMiOQy jWyhsObZGHoCwo11sF3b/423ej0vrdyXjteUXdSbUUwOrBhxy65FQAqvX1AvxMXp N0FjRQNmO1SXvLkeWCnVeuKMwPQ7NneOjrVwdw1XdfvImeWt9GL1J8956tzlsYuZ UMFcNMneiF1Fbcuc8O4MpOg8DGdTXP3ZwzvJZsihAdWHN0LLJELj+9z8+Gy5wEl4 8ipAKJEQEEmjhlLjc18p5d8IssIrUQKzQ2b5VRfC3NaeOMxtjcwtrtdA1sIzFC+C 91/Pr4WaAnzpMVS2aM+B =xFDE -----END PGP SIGNATURE-----
participants (2)
-
Hartmut Prochaska
-
Lunar