Changeset 3042


Ignore:
Timestamp:
Oct 7, 2012, 8:44:28 PM (7 years ago)
Author:
bruno
Message:
  • Fix some compilations warnings and 1 error
Location:
branches/3.0/mondo
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/3.0/mondo/src/common/libmondo-fork.c

    r3037 r3042  
    261261    /*@ int ********************************************************* */
    262262    int res;
    263     int i;
    264     int len;
    265263    bool log_if_failure = FALSE;
    266264    bool log_if_success = FALSE;
     
    285283        log_if_failure = TRUE;
    286284    }
    287     mr_asprintf(callstr, "%s > %s/mondo-run-prog-thing.tmp 2> %s/mondo-run-prog-thing.err", program, bkpinfo->tmpdir, bkpinfo->tmpdir);
     285    mr_asprintf(&callstr, "%s > %s/mondo-run-prog-thing.tmp 2> %s/mondo-run-prog-thing.err", program, bkpinfo->tmpdir, bkpinfo->tmpdir);
    288286    while ((p = strchr(callstr, '\r'))) {
    289287        *p = ' ';
     
    294292
    295293
    296     len = (int) strlen(program);
    297     for (i = 0; i < 35 - len / 2; i++) {
    298         tmp[i] = '-';
    299     }
    300     tmp[i] = '\0';
    301     strcat(tmp, " ");
    302     strcat(tmp, program);
    303     strcat(tmp, " ");
    304     for (i = 0; i < 35 - len / 2; i++) {
    305         strcat(tmp, "-");
    306     }
    307     strcpy(initial_label, tmp);
    308294    res = system(callstr);
    309295    if (((res == 0) && log_if_success) || ((res != 0) && log_if_failure)) {
     
    313299    mr_free(callstr);
    314300
    315     mr_asprintf(callstr, "cat %s/mondo-run-prog-thing.err >> %s/mondo-run-prog-thing.tmp 2> /dev/null", bkpinfo->tmpdir, bkpinfo->tmpdir);
     301    mr_asprintf(&callstr, "cat %s/mondo-run-prog-thing.err >> %s/mondo-run-prog-thing.tmp 2> /dev/null", bkpinfo->tmpdir, bkpinfo->tmpdir);
    316302    if (log_if_failure && system(callstr)) {
    317303        log_OS_error("Command failed");
     
    319305    mr_free(callstr);
    320306
    321     mr_asprintf(tmp1, "%s/mondo-run-prog-thing.err", bkpinfo->tmpdir);
     307    mr_asprintf(&tmp1, "%s/mondo-run-prog-thing.err", bkpinfo->tmpdir);
    322308    unlink(tmp1);
    323309    mr_free(tmp1);
    324310
    325     mr_asprintf(tmp1, "%s/mondo-run-prog-thing.tmp", bkpinfo->tmpdir);
     311    mr_asprintf(&tmp1, "%s/mondo-run-prog-thing.tmp", bkpinfo->tmpdir);
    326312    fin = fopen(tmp1, "r");
    327313    if (fin) {
  • branches/3.0/mondo/src/common/libmondo-string-EXT.h

    r2355 r3042  
    2525extern void strip_spaces(char *in_out);
    2626extern char *trim_empty_quotes(char *incoming);
    27 extern char *truncate_to_drive_name(char *partition);
     27extern char *truncate_to_drive_name(const char *partition);
    2828extern char *turn_raid_level_number_to_string(int raid_level);
    2929
  • branches/3.0/mondo/src/common/libmondo-string.c

    r2980 r3042  
    811811 * @return @p partition.
    812812 */
    813 char *truncate_to_drive_name(char *partition)
     813char *truncate_to_drive_name(const char *partition)
    814814{
    815815    int i = strlen(partition) - 1;
  • branches/3.0/mondo/src/common/libmondo-string.h

    r2355 r3042  
    2121void strip_spaces(char *in_out);
    2222char *trim_empty_quotes(char *incoming);
    23 char *truncate_to_drive_name(char *partition);
     23char *truncate_to_drive_name(const char *partition);
    2424char *turn_raid_level_number_to_string(int raid_level);
    2525void printf_silly_message(void);
  • branches/3.0/mondo/src/common/libmondo-tools.c

    r2982 r3042  
    647647                colon++;
    648648                hent = gethostbyname(colon);
    649                 mr_asprintf(bkpinfo->netfs_user,"%s", hostname);
     649                mr_asprintf(&(bkpinfo->netfs_user),"%s", hostname);
    650650            } else {
    651651                hent = gethostbyname(hostname);
  • branches/3.0/mondo/src/mondorestore/mondoprep.h

    r684 r3042  
    8282
    8383
    84 char *truncate_to_drive_name(char *partition);
     84char *truncate_to_drive_name(const char *partition);
    8585void create_mountlist_for_drive(struct mountlist_itself *mountlist,
    8686                                char *drive_name,
  • branches/3.0/mondo/test/test-truncname.c

    r2236 r3042  
    4141
    4242extern char *MONDO_LOGFILE;
    43 extern char *truncate_to_drive_name(char *);
     43extern char *truncate_to_drive_name(const char *);
    4444/* We don't have a cleanup function yet */
    4545void (*mr_cleanup)(void) = NULL;
Note: See TracChangeset for help on using the changeset viewer.