mirror of
https://github.com/alsa-project/alsa-utils
synced 2024-12-22 13:06:32 +01:00
Update utils.c spaces
This commit is contained in:
parent
71b5ee6aee
commit
62b4073ccd
1 changed files with 44 additions and 44 deletions
|
@ -81,50 +81,50 @@ size_t line_width(const char *buf, size_t bufsize, size_t pos)
|
|||
|
||||
void initfailed(int cardnumber, const char *reason, int exitcode)
|
||||
{
|
||||
int fp;
|
||||
char *str;
|
||||
char sexitcode[16];
|
||||
ssize_t bytes_written;
|
||||
|
||||
if (statefile == NULL)
|
||||
return;
|
||||
if (snd_card_get_name(cardnumber, &str) < 0)
|
||||
return;
|
||||
sprintf(sexitcode, "%i", exitcode);
|
||||
fp = open(statefile, O_WRONLY|O_CREAT|O_APPEND, 0644);
|
||||
|
||||
bytes_written = write(fp, str, strlen(str));
|
||||
if (bytes_written != strlen(str)) {
|
||||
// Handle error
|
||||
}
|
||||
|
||||
bytes_written = write(fp, ":", 1);
|
||||
if (bytes_written != 1) {
|
||||
// Handle error
|
||||
}
|
||||
|
||||
bytes_written = write(fp, reason, strlen(reason));
|
||||
if (bytes_written != strlen(reason)) {
|
||||
// Handle error
|
||||
}
|
||||
|
||||
bytes_written = write(fp, ":", 1);
|
||||
if (bytes_written != 1) {
|
||||
// Handle error
|
||||
}
|
||||
|
||||
bytes_written = write(fp, sexitcode, strlen(sexitcode));
|
||||
if (bytes_written != strlen(sexitcode)) {
|
||||
// Handle error
|
||||
}
|
||||
|
||||
bytes_written = write(fp, "\n", 1);
|
||||
if (bytes_written != 1) {
|
||||
// Handle error
|
||||
}
|
||||
|
||||
close(fp);
|
||||
free(str);
|
||||
int fp;
|
||||
char *str;
|
||||
char sexitcode[16];
|
||||
ssize_t bytes_written;
|
||||
|
||||
if (statefile == NULL)
|
||||
return;
|
||||
if (snd_card_get_name(cardnumber, &str) < 0)
|
||||
return;
|
||||
sprintf(sexitcode, "%i", exitcode);
|
||||
fp = open(statefile, O_WRONLY|O_CREAT|O_APPEND, 0644);
|
||||
|
||||
bytes_written = write(fp, str, strlen(str));
|
||||
if (bytes_written != strlen(str)) {
|
||||
// Handle error
|
||||
}
|
||||
|
||||
bytes_written = write(fp, ":", 1);
|
||||
if (bytes_written != 1) {
|
||||
// Handle error
|
||||
}
|
||||
|
||||
bytes_written = write(fp, reason, strlen(reason));
|
||||
if (bytes_written != strlen(reason)) {
|
||||
// Handle error
|
||||
}
|
||||
|
||||
bytes_written = write(fp, ":", 1);
|
||||
if (bytes_written != 1) {
|
||||
// Handle error
|
||||
}
|
||||
|
||||
bytes_written = write(fp, sexitcode, strlen(sexitcode));
|
||||
if (bytes_written != strlen(sexitcode)) {
|
||||
// Handle error
|
||||
}
|
||||
|
||||
bytes_written = write(fp, "\n", 1);
|
||||
if (bytes_written != 1) {
|
||||
// Handle error
|
||||
}
|
||||
|
||||
close(fp);
|
||||
free(str);
|
||||
}
|
||||
|
||||
static void syslog_(int prio, const char *fcn, long line,
|
||||
|
|
Loading…
Reference in a new issue