<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def get_pidfile(pidfile):
    '''
    Return the pid from a pidfile as an integer
    '''
    try:
        with salt.utils.files.fopen(pidfile) as pdf:
            pid = pdf.read().strip()
        return int(pid)
    except (OSError, IOError, TypeError, ValueError):
        return -1