Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CommandLine.c
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ int CommandLine_run(int argc, char** argv) {
#endif /* NDEBUG */
int r = Settings_write(settings, false);
if (r < 0)
fprintf(stderr, "Can not save configuration to %s: %s\n", settings->filename, strerror(-r));
fprintf(stderr, "Cannot save configuration to %s: %s\n", settings->filename, strerror(-r));
}

Header_delete(header);
Expand Down
2 changes: 1 addition & 1 deletion docs/styleguide.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ Thus when you want to use such features you should try to have an alternative av

An example for this are functions like `fstatat` on Linux that extend the kernel API on modern systems.
But even though it has been around for over a decade you are asked to provide a POSIX alternative like emulating such calls by `fstat` if this is doable.
If an alternative can not be provided you should gracefully downgrade. That could make a feature that requires this shiny API unavailable on systems that lack support for that API. Make this case visually clear to the user.
If an alternative cannot be provided you should gracefully downgrade. That could make a feature that requires this shiny API unavailable on systems that lack support for that API. Make this case visually clear to the user.

In general, code written for the project should be able to compile on any C99-compliant compiler.

Expand Down
2 changes: 1 addition & 1 deletion dragonflybsd/DragonFlyBSDMachine.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ static void DragonFlyBSDMachine_scanMemoryInfo(Machine* super) {
// user_free (avail to procs) = buffers + inactive + cache + free
size_t len = sizeof(super->totalMem);

//disabled for now, as it is always smaller than phycal amount of memory...
//disabled for now, as it is always smaller than physical amount of memory...
//...to avoid "where is my memory?" questions
//sysctl(MIB_vm_stats_vm_v_page_count, 4, &(this->totalMem), &len, NULL, 0);
//this->totalMem *= pageSizeKb;
Expand Down
2 changes: 1 addition & 1 deletion freebsd/FreeBSDMachine.c
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ static void FreeBSDMachine_scanMemoryInfo(Machine* super) {
size_t len;
struct vmtotal vmtotal;

//disabled for now, as it is always smaller than phycal amount of memory...
//disabled for now, as it is always smaller than physical amount of memory...
//...to avoid "where is my memory?" questions
//sysctl(MIB_vm_stats_vm_v_page_count, 4, &(super->totalMem), &len, NULL, 0);
//super->totalMem *= this->pageSizeKb;
Expand Down
4 changes: 2 additions & 2 deletions linux/LinuxProcess.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ void Process_delete(Object* cast) {
[1] Note that before kernel 2.6.26 a process that has not asked for
an io priority formally uses "none" as scheduling class, but the
io scheduler will treat such processes as if it were in the best
effort class. The priority within the best effort class will be
dynamically derived from the cpu nice level of the process:
effort class. The priority within the best effort class will be
dynamically derived from the cpu nice level of the process:
io_priority = (cpu_nice + 20) / 5. -- From ionice(1) man page
*/
static int LinuxProcess_effectiveIOPriority(const LinuxProcess* this) {
Expand Down
14 changes: 7 additions & 7 deletions linux/Platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -1042,19 +1042,19 @@ static int dropCapabilities(enum CapMode mode) {

cap_t caps = cap_init();
if (caps == NULL) {
fprintf(stderr, "Error: can not initialize capabilities: %s\n", strerror(errno));
fprintf(stderr, "Error: cannot initialize capabilities: %s\n", strerror(errno));
return -1;
}

if (cap_clear(caps) < 0) {
fprintf(stderr, "Error: can not clear capabilities: %s\n", strerror(errno));
fprintf(stderr, "Error: cannot clear capabilities: %s\n", strerror(errno));
cap_free(caps);
return -1;
}

cap_t currCaps = cap_get_proc();
if (currCaps == NULL) {
fprintf(stderr, "Error: can not get current process capabilities: %s\n", strerror(errno));
fprintf(stderr, "Error: cannot get current process capabilities: %s\n", strerror(errno));
cap_free(caps);
return -1;
}
Expand All @@ -1065,7 +1065,7 @@ static int dropCapabilities(enum CapMode mode) {

cap_flag_value_t current;
if (cap_get_flag(currCaps, keepcaps[i], CAP_PERMITTED, &current) < 0) {
fprintf(stderr, "Error: can not get current value of capability %d: %s\n", keepcaps[i], strerror(errno));
fprintf(stderr, "Error: cannot get current value of capability %d: %s\n", keepcaps[i], strerror(errno));
cap_free(currCaps);
cap_free(caps);
return -1;
Expand All @@ -1075,22 +1075,22 @@ static int dropCapabilities(enum CapMode mode) {
continue;

if (cap_set_flag(caps, CAP_PERMITTED, 1, &keepcaps[i], CAP_SET) < 0) {
fprintf(stderr, "Error: can not set permitted capability %d: %s\n", keepcaps[i], strerror(errno));
fprintf(stderr, "Error: cannot set permitted capability %d: %s\n", keepcaps[i], strerror(errno));
cap_free(currCaps);
cap_free(caps);
return -1;
}

if (cap_set_flag(caps, CAP_EFFECTIVE, 1, &keepcaps[i], CAP_SET) < 0) {
fprintf(stderr, "Error: can not set effective capability %d: %s\n", keepcaps[i], strerror(errno));
fprintf(stderr, "Error: cannot set effective capability %d: %s\n", keepcaps[i], strerror(errno));
cap_free(currCaps);
cap_free(caps);
return -1;
}
}

if (cap_set_proc(caps) < 0) {
fprintf(stderr, "Error: can not set process capabilities: %s\n", strerror(errno));
fprintf(stderr, "Error: cannot set process capabilities: %s\n", strerror(errno));
cap_free(currCaps);
cap_free(caps);
return -1;
Expand Down
2 changes: 1 addition & 1 deletion linux/PressureStallMeter.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ static void PressureStallMeter_updateValues(Meter* this) {

Platform_getPressureStall(file, some, &this->values[0], &this->values[1], &this->values[2]);

/* only print bar for ten (not sixty and threehundred), cause the sum is meaningless */
/* only print bar for ten (not sixty and three hundred), cause the sum is meaningless */
this->curItems = 1;

xSnprintf(this->txtBuffer, sizeof(this->txtBuffer), "%s %s %5.2lf%% %5.2lf%% %5.2lf%%", some ? "some" : "full", file, this->values[0], this->values[1], this->values[2]);
Expand Down
2 changes: 1 addition & 1 deletion solaris/Platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ in the source distribution for its full text.
#include <kstat.h>

/* On OmniOS /usr/include/sys/regset.h redefines ERR to 13 - \r, breaking the Enter key.
* Since ncruses macros use the ERR macro, we can not use another name.
* Since ncruses macros use the ERR macro, we cannot use another name.
*/
#undef ERR
#include <libproc.h>
Expand Down
2 changes: 1 addition & 1 deletion solaris/SolarisProcess.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ in the source distribution for its full text.
#include <sys/proc.h>

/* On OmniOS /usr/include/sys/regset.h redefines ERR to 13 - \r, breaking the Enter key.
* Since ncruses macros use the ERR macro, we can not use another name.
* Since ncruses macros use the ERR macro, we cannot use another name.
*/
#undef ERR
#include <libproc.h>
Expand Down
Loading