diff options
Diffstat (limited to 'util/lock')
-rw-r--r-- | util/lock/android.c | 5 | ||||
-rw-r--r-- | util/lock/android.h | 5 | ||||
-rw-r--r-- | util/lock/build.mk | 2 | ||||
-rw-r--r-- | util/lock/file_lock.c | 20 | ||||
-rw-r--r-- | util/lock/gec_lock.c | 5 | ||||
-rw-r--r-- | util/lock/gec_lock.h | 5 | ||||
-rw-r--r-- | util/lock/ipc_lock.h | 21 | ||||
-rw-r--r-- | util/lock/locks.h | 11 |
8 files changed, 33 insertions, 41 deletions
diff --git a/util/lock/android.c b/util/lock/android.c index 8472b6db68..857d6a9473 100644 --- a/util/lock/android.c +++ b/util/lock/android.c @@ -1,6 +1,5 @@ /* - * Copyright 2016, Google Inc. - * All rights reserved. + * Copyright 2016 Google LLC * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -12,7 +11,7 @@ * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. - * * Neither the name of Google Inc. nor the names of its + * * Neither the name of Google LLC nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * diff --git a/util/lock/android.h b/util/lock/android.h index bb08486919..dfdd16ce97 100644 --- a/util/lock/android.h +++ b/util/lock/android.h @@ -1,6 +1,5 @@ /* - * Copyright 2016, Google Inc. - * All rights reserved. + * Copyright 2016 Google LLC * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -12,7 +11,7 @@ * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. - * * Neither the name of Google Inc. nor the names of its + * * Neither the name of Google LLC nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * diff --git a/util/lock/build.mk b/util/lock/build.mk index 65a63ab9db..ea9bf9bf04 100644 --- a/util/lock/build.mk +++ b/util/lock/build.mk @@ -1,5 +1,5 @@ # -*- makefile -*- -# Copyright 2012 The Chromium OS Authors. All rights reserved. +# Copyright 2012 The ChromiumOS Authors # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # diff --git a/util/lock/file_lock.c b/util/lock/file_lock.c index 36b420d287..c0ed8bd88c 100644 --- a/util/lock/file_lock.c +++ b/util/lock/file_lock.c @@ -1,5 +1,4 @@ -/* Copyright 2016, Google Inc. - * All rights reserved. +/* Copyright 2016 Google LLC * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. - * * Neither the name of Google Inc. nor the names of its + * * Neither the name of Google LLC nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * @@ -59,7 +58,7 @@ #include "ipc_lock.h" #include "locks.h" -#define SLEEP_INTERVAL_MS 50 +#define SLEEP_INTERVAL_MS 50 static void msecs_to_timespec(int msecs, struct timespec *tmspec) { @@ -100,8 +99,8 @@ static int file_lock_open_or_create(struct ipc_lock *lock) if (!tmpdir) return -1; - if (snprintf(path, sizeof(path), "%s/%s", - tmpdir, lock->filename) < 0) { + if (snprintf(path, sizeof(path), "%s/%s", tmpdir, + lock->filename) < 0) { return -1; } } else { @@ -115,10 +114,9 @@ static int file_lock_open_or_create(struct ipc_lock *lock) return -1; } - if (snprintf(path, sizeof(path), - "%s/%s", dir, lock->filename) < 0) + if (snprintf(path, sizeof(path), "%s/%s", dir, lock->filename) < + 0) return -1; - } lock->fd = open(path, O_RDWR | O_CREAT, 0600); @@ -180,9 +178,9 @@ static int file_lock_write_pid(struct ipc_lock *lock) { ssize_t len; /* - * PIDs are usually 5 digits, but we'll reserve enough room for + * PIDs are usually 5 digits, but we'll reserve enough room for * a value of 2^32 (10 digits) out of paranoia. - */ + */ char pid_str[11]; if (ftruncate(lock->fd, 0) < 0) { diff --git a/util/lock/gec_lock.c b/util/lock/gec_lock.c index d354ea08f3..64aad0f353 100644 --- a/util/lock/gec_lock.c +++ b/util/lock/gec_lock.c @@ -1,5 +1,4 @@ -/* Copyright 2012, Google Inc. - * All rights reserved. +/* Copyright 2012 Google LLC * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. - * * Neither the name of Google Inc. nor the names of its + * * Neither the name of Google LLC nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * diff --git a/util/lock/gec_lock.h b/util/lock/gec_lock.h index 8480700ddd..2e0d8018bc 100644 --- a/util/lock/gec_lock.h +++ b/util/lock/gec_lock.h @@ -1,5 +1,4 @@ -/* Copyright 2012, Google Inc. - * All rights reserved. +/* Copyright 2012 Google LLC * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. - * * Neither the name of Google Inc. nor the names of its + * * Neither the name of Google LLC nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * diff --git a/util/lock/ipc_lock.h b/util/lock/ipc_lock.h index 5d0d321af4..aaa4217ae8 100644 --- a/util/lock/ipc_lock.h +++ b/util/lock/ipc_lock.h @@ -1,5 +1,4 @@ -/* Copyright 2012, Google Inc. - * All rights reserved. +/* Copyright 2012 Google LLC * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. - * * Neither the name of Google Inc. nor the names of its + * * Neither the name of Google LLC nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * @@ -32,17 +31,17 @@ #define __UTIL_IPC_LOCK_H struct ipc_lock { - int is_held; /* internal */ - const char *filename; /* provided by the developer */ - int fd; /* internal */ + int is_held; /* internal */ + const char *filename; /* provided by the developer */ + int fd; /* internal */ }; /* don't use C99 initializers here, so this can be used in C++ code */ -#define LOCKFILE_INIT(lockfile) \ - { \ - 0, /* is_held */ \ - lockfile, /* filename */ \ - -1, /* fd */ \ +#define LOCKFILE_INIT(lockfile) \ + { \ + 0, /* is_held */ \ + lockfile, /* filename */ \ + -1, /* fd */ \ } /* diff --git a/util/lock/locks.h b/util/lock/locks.h index 6875d91454..9e470b5f7e 100644 --- a/util/lock/locks.h +++ b/util/lock/locks.h @@ -1,5 +1,4 @@ -/* Copyright 2012, Google Inc. - * All rights reserved. +/* Copyright 2012 Google LLC * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. - * * Neither the name of Google Inc. nor the names of its + * * Neither the name of Google LLC nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * @@ -31,8 +30,8 @@ #ifndef __UTIL_LOCKS_H #define __UTIL_LOCKS_H -#define SYSTEM_LOCKFILE_DIR "/run/lock" -#define LOCKFILE_NAME "firmware_utility_lock" -#define CROS_EC_LOCKFILE_NAME "cros_ec_lock" +#define SYSTEM_LOCKFILE_DIR "/run/lock" +#define LOCKFILE_NAME "firmware_utility_lock" +#define CROS_EC_LOCKFILE_NAME "cros_ec_lock" #endif /* __UTIL_LOCKS_H */ |