Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(246)

Side by Side Diff: src/nonsfi/linux/irt_signal_handling.c

Issue 1419373002: Use size_t for loop counter to avoid sign comparison warning (Closed) Base URL: https://chromium.googlesource.com/native_client/src/native_client.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2015 The Native Client Authors. All rights reserved. 2 * Copyright (c) 2015 The Native Client Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be 3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file. 4 * found in the LICENSE file.
5 */ 5 */
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <pthread.h> 8 #include <pthread.h>
9 #include <signal.h> 9 #include <signal.h>
10 #include <stdint.h> 10 #include <stdint.h>
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after
470 */ 470 */
471 memset(&mask, 0, sizeof(mask)); 471 memset(&mask, 0, sizeof(mask));
472 472
473 /* 473 /*
474 * Hack to be able to reuse sigset_t utilities from newlib for the 474 * Hack to be able to reuse sigset_t utilities from newlib for the
475 * first lower 4 bytes of the signal, works because we are all 475 * first lower 4 bytes of the signal, works because we are all
476 * little endians. 476 * little endians.
477 */ 477 */
478 sigset_t *maskptr = (sigset_t *) &mask; 478 sigset_t *maskptr = (sigset_t *) &mask;
479 sigemptyset(maskptr); 479 sigemptyset(maskptr);
480 for (int a = 0; a < NACL_ARRAY_SIZE(kSignals); a++) { 480 for (size_t a = 0; a < NACL_ARRAY_SIZE(kSignals); a++) {
481 if (sigaddset(maskptr, kSignals[a]) != 0) 481 if (sigaddset(maskptr, kSignals[a]) != 0)
482 abort(); 482 abort();
483 } 483 }
484 if (linux_sigprocmask(LINUX_SIG_UNBLOCK, &mask, NULL) != 0) 484 if (linux_sigprocmask(LINUX_SIG_UNBLOCK, &mask, NULL) != 0)
485 abort(); 485 abort();
486 486
487 return 0; 487 return 0;
488 } 488 }
489 489
490 int nacl_exception_set_stack(void *p, size_t s) { 490 int nacl_exception_set_stack(void *p, size_t s) {
(...skipping 13 matching lines...) Expand all
504 504
505 int nacl_async_signal_send_async_signal(nacl_irt_tid_t tid) { 505 int nacl_async_signal_send_async_signal(nacl_irt_tid_t tid) {
506 if (!g_signal_handler_initialized) 506 if (!g_signal_handler_initialized)
507 return ESRCH; 507 return ESRCH;
508 if (tid == 0) 508 if (tid == 0)
509 tid = g_main_tid; 509 tid = g_main_tid;
510 if (linux_tgkill(g_tgid, tid, LINUX_SIGUSR1) == -1) 510 if (linux_tgkill(g_tgid, tid, LINUX_SIGUSR1) == -1)
511 return errno; 511 return errno;
512 return 0; 512 return 0;
513 } 513 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698