summaryrefslogtreecommitdiffstats
path: root/ax25/axgetput/util.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2013-06-05 01:47:40 +0200
committerRalf Baechle <ralf@linux-mips.org>2013-06-17 17:12:26 +0200
commit90f6ab2eceada8987fc6e5017ae415eade165c00 (patch)
tree6dd7d7f057512b69861faa9c72420929789227db /ax25/axgetput/util.c
parent5feb3d651dbd1b096a26963bd1dffcfe0a5f9eea (diff)
Use tabs for indentation, not spaces.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'ax25/axgetput/util.c')
-rw-r--r--ax25/axgetput/util.c66
1 files changed, 33 insertions, 33 deletions
diff --git a/ax25/axgetput/util.c b/ax25/axgetput/util.c
index 98caeeb..f20937f 100644
--- a/ax25/axgetput/util.c
+++ b/ax25/axgetput/util.c
@@ -54,8 +54,8 @@ int my_read(int fd, char *s, int len_max, int *eof, char *p_break)
if ((len = read(fd, s_curr, (p_break ? 1 : len_max))) < 1) {
if (len == -1 && errno == EAGAIN) {
- sleep(10);
- continue;
+ sleep(10);
+ continue;
}
*eof = 1;
/*
@@ -89,8 +89,8 @@ int secure_write(int fd, char *s, int len_write) {
int len;
if ((len = write(fd, s, len_write_left_curr)) < 0) {
if (len == -1 && errno == EAGAIN) {
- sleep(10);
- continue;
+ sleep(10);
+ continue;
}
return -1;
}
@@ -162,22 +162,22 @@ char *get_fixed_filename(char *line, long size, unsigned int msg_crc, int genera
/* Linear day numbers of the respective 1sts in non-leap years. */
static int day_n[] = { 0,31,59,90,120,151,181,212,243,273,304,334,0,0,0,0 };
- /* JanFebMarApr May Jun Jul Aug Sep Oct Nov Dec */
+ /* JanFebMarApr May Jun Jul Aug Sep Oct Nov Dec */
/*---------------------------------------------------------------------------*/
long date_dos2unix(unsigned short time,unsigned short date)
{
- int month,year;
- long secs;
-
- month = ((date >> 5) & 15)-1;
- year = date >> 9;
- secs = (time & 31)*2+60*((time >> 5) & 63)+(time >> 11)*3600+86400*
- ((date & 31)-1+day_n[month]+(year/4)+year*365-((year & 3) == 0 &&
- month < 2 ? 1 : 0)+3653);
- /* days since 1.1.70 plus 80's leap day */
- return secs;
+ int month,year;
+ long secs;
+
+ month = ((date >> 5) & 15)-1;
+ year = date >> 9;
+ secs = (time & 31)*2+60*((time >> 5) & 63)+(time >> 11)*3600+86400*
+ ((date & 31)-1+day_n[month]+(year/4)+year*365-((year & 3) == 0 &&
+ month < 2 ? 1 : 0)+3653);
+ /* days since 1.1.70 plus 80's leap day */
+ return secs;
}
/*---------------------------------------------------------------------------*/
@@ -186,22 +186,22 @@ long date_dos2unix(unsigned short time,unsigned short date)
void date_unix2dos(int unix_date,unsigned short *time, unsigned short *date)
{
- int day,year,nl_day,month;
-
- *time = (unix_date % 60)/2+(((unix_date/60) % 60) << 5)+
- (((unix_date/3600) % 24) << 11);
- day = unix_date/86400-3652;
- year = day/365;
- if ((year+3)/4+365*year > day) year--;
- day -= (year+3)/4+365*year;
- if (day == 59 && !(year & 3)) {
- nl_day = day;
- month = 2;
- }
- else {
- nl_day = (year & 3) || day <= 59 ? day : day-1;
- for (month = 0; month < 12; month++)
- if (day_n[month] > nl_day) break;
- }
- *date = nl_day-day_n[month-1]+1+(month << 5)+(year << 9);
+ int day,year,nl_day,month;
+
+ *time = (unix_date % 60)/2+(((unix_date/60) % 60) << 5)+
+ (((unix_date/3600) % 24) << 11);
+ day = unix_date/86400-3652;
+ year = day/365;
+ if ((year+3)/4+365*year > day) year--;
+ day -= (year+3)/4+365*year;
+ if (day == 59 && !(year & 3)) {
+ nl_day = day;
+ month = 2;
+ }
+ else {
+ nl_day = (year & 3) || day <= 59 ? day : day-1;
+ for (month = 0; month < 12; month++)
+ if (day_n[month] > nl_day) break;
+ }
+ *date = nl_day-day_n[month-1]+1+(month << 5)+(year << 9);
}