kern_fail.c (192908) | kern_fail.c (201758) |
---|---|
1/*- 2 * Copyright (c) 2009 Isilon Inc http://www.isilon.com/ 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. --- 36 unchanged lines hidden (view full) --- 45 * @ingroup failpoint 46 */ 47/** 48 * @addtogroup failpoint_private 49 * @{ 50 */ 51 52#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2009 Isilon Inc http://www.isilon.com/ 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. --- 36 unchanged lines hidden (view full) --- 45 * @ingroup failpoint 46 */ 47/** 48 * @addtogroup failpoint_private 49 * @{ 50 */ 51 52#include <sys/cdefs.h> |
53__FBSDID("$FreeBSD: head/sys/kern/kern_fail.c 192908 2009-05-27 16:36:54Z zml $"); | 53__FBSDID("$FreeBSD: head/sys/kern/kern_fail.c 201758 2010-01-07 21:01:37Z mbr $"); |
54 55#include <sys/errno.h> 56#include <sys/fail.h> 57#include <sys/kernel.h> 58#include <sys/libkern.h> 59#include <sys/lock.h> 60#include <sys/malloc.h> 61#include <sys/mutex.h> --- 385 unchanged lines hidden (view full) --- 447 units = 100; 448 ent->fe_prob = units * (PROB_MAX / 100) + decimal; 449 if (ent->fe_prob > PROB_MAX) 450 ent->fe_prob = PROB_MAX; 451 452 } else if (*p == '*') { 453 if (!units || decimal) 454 return 0; | 54 55#include <sys/errno.h> 56#include <sys/fail.h> 57#include <sys/kernel.h> 58#include <sys/libkern.h> 59#include <sys/lock.h> 60#include <sys/malloc.h> 61#include <sys/mutex.h> --- 385 unchanged lines hidden (view full) --- 447 units = 100; 448 ent->fe_prob = units * (PROB_MAX / 100) + decimal; 449 if (ent->fe_prob > PROB_MAX) 450 ent->fe_prob = PROB_MAX; 451 452 } else if (*p == '*') { 453 if (!units || decimal) 454 return 0; |
455 ent->fe_count = units;; | 455 ent->fe_count = units; |
456 457 } else { 458 return 0; 459 } 460 461 p++; 462 } 463 --- 28 unchanged lines hidden (view full) --- 492 /* 493 * <number> :: 494 * <integer> [ "." <integer> ] | 495 * "." <integer> 496 */ 497 498 /* whole part */ 499 old_p = p; | 456 457 } else { 458 return 0; 459 } 460 461 p++; 462 } 463 --- 28 unchanged lines hidden (view full) --- 492 /* 493 * <number> :: 494 * <integer> [ "." <integer> ] | 495 * "." <integer> 496 */ 497 498 /* whole part */ 499 old_p = p; |
500 *out_units = strtol(p, &p, 10);; | 500 *out_units = strtol(p, &p, 10); |
501 if (p == old_p && *p != '.') 502 return 0; 503 504 /* fractional part */ 505 *out_decimal = 0; 506 if (*p == '.') { 507 int digits = 0; 508 p++; --- 67 unchanged lines hidden --- | 501 if (p == old_p && *p != '.') 502 return 0; 503 504 /* fractional part */ 505 *out_decimal = 0; 506 if (*p == '.') { 507 int digits = 0; 508 p++; --- 67 unchanged lines hidden --- |